]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix firelock prediction issues with periodic pulses of closing lights (#28227)
authornikthechampiongr <32041239+nikthechampiongr@users.noreply.github.com>
Fri, 24 May 2024 14:44:42 +0000 (14:44 +0000)
committerGitHub <noreply@github.com>
Fri, 24 May 2024 14:44:42 +0000 (16:44 +0200)
* Fix firelock prediction issues with periodic pulses of closing lights

For some reason this function was setting a time for the next state
which was triggering the door system to try to close the firelock.
This does not happen serverside because the function only fires from an
event called clientside apparently.
It appears to be an attempt to stop firelocks from closing instantly
that did not function properly, and I cannot discern any other purpose.
As such I have removed it.

* Remove redundant serverside check

This became redundant with commit 439a87f2

Content.Server/Doors/Systems/FirelockSystem.cs
Content.Shared/Doors/Components/FirelockComponent.cs
Content.Shared/Doors/Systems/SharedFirelockSystem.cs

index 5ad86fb20aab11a2263ce0b8141ac4bd0c33cec0..e2b8b5829d1838321c43a2e713d279f4d1300af5 100644 (file)
@@ -28,8 +28,6 @@ namespace Content.Server.Doors.Systems
         {
             base.Initialize();
 
-
-            SubscribeLocalEvent<FirelockComponent, BeforeDoorAutoCloseEvent>(OnBeforeDoorAutoclose);
             SubscribeLocalEvent<FirelockComponent, AtmosAlarmEvent>(OnAtmosAlarm);
 
             SubscribeLocalEvent<FirelockComponent, PowerChangedEvent>(PowerChanged);
@@ -80,19 +78,6 @@ namespace Content.Server.Doors.Systems
             }
         }
 
-        private void OnBeforeDoorAutoclose(EntityUid uid, FirelockComponent component, BeforeDoorAutoCloseEvent args)
-        {
-            if (!this.IsPowered(uid, EntityManager))
-                args.Cancel();
-
-            // Make firelocks autoclose, but only if the last alarm type it
-            // remembers was a danger. This is to prevent people from
-            // flooding hallways with endless bad air/fire.
-            if (component.AlarmAutoClose &&
-                (_atmosAlarmable.TryGetHighestAlert(uid, out var alarm) && alarm != AtmosAlarmType.Danger || alarm == null))
-                args.Cancel();
-        }
-
         private void OnAtmosAlarm(EntityUid uid, FirelockComponent component, AtmosAlarmEvent args)
         {
             if (!this.IsPowered(uid, EntityManager))
index ca62daaa0fd100f3bc90abf35e8a0d906e97492c..3f7d6c3f704968332476f1fb50d9a5575648fbe1 100644 (file)
@@ -19,8 +19,6 @@ namespace Content.Shared.Doors.Components
         [DataField("lockedPryTimeModifier"), ViewVariables(VVAccess.ReadWrite)]
         public float LockedPryTimeModifier = 1.5f;
 
-        [DataField("autocloseDelay")] public TimeSpan AutocloseDelay = TimeSpan.FromSeconds(3f);
-
         /// <summary>
         /// Maximum pressure difference before the firelock will refuse to open, in kPa.
         /// </summary>
index 7d033efdd408fa0951af5fc78a93cbf4dc00b213..47a29a4ba803d9889d8cc6ca2cf8c8496c6b45fd 100644 (file)
@@ -18,8 +18,6 @@ public abstract class SharedFirelockSystem : EntitySystem
     {
         base.Initialize();
 
-        SubscribeLocalEvent<FirelockComponent, DoorStateChangedEvent>(OnUpdateState);
-
         // Access/Prying
         SubscribeLocalEvent<FirelockComponent, BeforeDoorOpenedEvent>(OnBeforeDoorOpened);
         SubscribeLocalEvent<FirelockComponent, GetPryTimeModifierEvent>(OnDoorGetPryTimeModifier);
@@ -46,19 +44,6 @@ public abstract class SharedFirelockSystem : EntitySystem
         return _doorSystem.OnPartialClose(uid, door);
     }
 
-    private void OnUpdateState(EntityUid uid, FirelockComponent component, DoorStateChangedEvent args)
-    {
-        var ev = new BeforeDoorAutoCloseEvent();
-        RaiseLocalEvent(uid, ev);
-        UpdateVisuals(uid, component, args);
-        if (ev.Cancelled)
-        {
-            return;
-        }
-
-        _doorSystem.SetNextStateChange(uid, component.AutocloseDelay);
-    }
-
     #region Access/Prying
 
     private void OnBeforeDoorOpened(EntityUid uid, FirelockComponent component, BeforeDoorOpenedEvent args)