From bedccf8e31c53faff90f46822efce6143e6dc2e1 Mon Sep 17 00:00:00 2001 From: Kot <1192090+koteq@users.noreply.github.com> Date: Tue, 6 Feb 2024 03:31:21 +0400 Subject: [PATCH] Allow opening doors mid-deny animation, if you have the access (#24969) Allow opening doors mid-deny animation, if you have access ofc --- .../DeviceLinking/Systems/DoorSignalControlSystem.cs | 3 +-- Content.Server/Doors/Systems/DoorSystem.cs | 4 ++-- Content.Shared/Doors/Systems/SharedDoorSystem.cs | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Content.Server/DeviceLinking/Systems/DoorSignalControlSystem.cs b/Content.Server/DeviceLinking/Systems/DoorSignalControlSystem.cs index 56a754a756..90623dbae3 100644 --- a/Content.Server/DeviceLinking/Systems/DoorSignalControlSystem.cs +++ b/Content.Server/DeviceLinking/Systems/DoorSignalControlSystem.cs @@ -59,8 +59,7 @@ namespace Content.Server.DeviceLinking.Systems { if (state == SignalState.High || state == SignalState.Momentary) { - if (door.State is DoorState.Closed or DoorState.Open) - _doorSystem.TryToggleDoor(uid, door); + _doorSystem.TryToggleDoor(uid, door); } } else if (args.Port == component.InBolt) diff --git a/Content.Server/Doors/Systems/DoorSystem.cs b/Content.Server/Doors/Systems/DoorSystem.cs index fffc0a4e1f..d59ea59622 100644 --- a/Content.Server/Doors/Systems/DoorSystem.cs +++ b/Content.Server/Doors/Systems/DoorSystem.cs @@ -136,13 +136,13 @@ public sealed class DoorSystem : SharedDoorSystem if (!door.BumpOpen) return; - if (door.State != DoorState.Closed) + if (door.State is not (DoorState.Closed or DoorState.Denying)) return; var otherUid = args.OtherEntity; if (Tags.HasTag(otherUid, "DoorBumpOpener")) - TryOpen(uid, door, otherUid); + TryOpen(uid, door, otherUid, quiet: door.State == DoorState.Denying); } private void OnEmagged(EntityUid uid, DoorComponent door, ref GotEmaggedEvent args) { diff --git a/Content.Shared/Doors/Systems/SharedDoorSystem.cs b/Content.Shared/Doors/Systems/SharedDoorSystem.cs index 954c22df38..53d79cada7 100644 --- a/Content.Shared/Doors/Systems/SharedDoorSystem.cs +++ b/Content.Shared/Doors/Systems/SharedDoorSystem.cs @@ -212,9 +212,9 @@ public abstract class SharedDoorSystem : EntitySystem if (!Resolve(uid, ref door)) return false; - if (door.State == DoorState.Closed) + if (door.State is DoorState.Closed or DoorState.Denying) { - return TryOpen(uid, door, user, predicted); + return TryOpen(uid, door, user, predicted, quiet: door.State == DoorState.Denying); } else if (door.State == DoorState.Open) { -- 2.51.2