]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix airlock autoclose mispredict (#32477)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Fri, 27 Sep 2024 06:10:27 +0000 (16:10 +1000)
committerGitHub <noreply@github.com>
Fri, 27 Sep 2024 06:10:27 +0000 (16:10 +1000)
* Fix airlock autoclose mispredict

It was hard to see this ingame due to animations masking it. The only way you'd notice currently is the light mispredicting.

* cudin

Content.Shared/Doors/Systems/SharedAirlockSystem.cs

index c0c274207b62b68f8c0fabfec9dab47e2674b458..5a9cde74ee10fdcbed42535696dad2203c0b04df 100644 (file)
@@ -2,15 +2,16 @@ using Content.Shared.Doors.Components;
 using Content.Shared.Popups;
 using Content.Shared.Prying.Components;
 using Content.Shared.Wires;
+using Robust.Shared.Timing;
 
 namespace Content.Shared.Doors.Systems;
 
 public abstract class SharedAirlockSystem : EntitySystem
 {
+    [Dependency] private   readonly IGameTiming _timing = default!;
     [Dependency] protected readonly SharedAppearanceSystem Appearance = default!;
     [Dependency] protected readonly SharedDoorSystem DoorSystem = default!;
-    [Dependency] protected readonly SharedPopupSystem Popup = default!;
-    [Dependency] private readonly SharedWiresSystem _wiresSystem = default!;
+    [Dependency] private   readonly SharedWiresSystem _wiresSystem = default!;
 
     public override void Initialize()
     {
@@ -46,6 +47,10 @@ public abstract class SharedAirlockSystem : EntitySystem
 
     private void OnStateChanged(EntityUid uid, AirlockComponent component, DoorStateChangedEvent args)
     {
+        // This is here so we don't accidentally bulldoze state values and mispredict.
+        if (_timing.ApplyingState)
+            return;
+
         // Only show the maintenance panel if the airlock is closed
         if (TryComp<WiresPanelComponent>(uid, out var wiresPanel))
         {