]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix door animations mispredicting if closing is interrupted (#33481)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Sat, 23 Nov 2024 09:31:07 +0000 (20:31 +1100)
committerGitHub <noreply@github.com>
Sat, 23 Nov 2024 09:31:07 +0000 (10:31 +0100)
* Fix door animations mispredicting if closing is interrupted

On master it will flicker states a little bit partially due to it not being predicted.

Instead we'll just set it straight back to opening (no animation is ever played anyway).

* no log

Content.Shared/Doors/Systems/SharedDoorSystem.cs

index 80e7ff966986e30391a3d1fba4325d8e2467ab88..7fd5d61db7dd8ac74459f30a8a79819d22c9ea30 100644 (file)
@@ -461,17 +461,17 @@ public abstract partial class SharedDoorSystem : EntitySystem
         if (!Resolve(uid, ref door, ref physics))
             return false;
 
-        door.Partial = true;
-
         // Make sure no entity walked into the airlock when it started closing.
         if (!CanClose(uid, door))
         {
             door.NextStateChange = GameTiming.CurTime + door.OpenTimeTwo;
-            door.State = DoorState.Opening;
-            AppearanceSystem.SetData(uid, DoorVisuals.State, DoorState.Opening);
+            door.State = DoorState.Open;
+            AppearanceSystem.SetData(uid, DoorVisuals.State, DoorState.Open);
+            Dirty(uid, door);
             return false;
         }
 
+        door.Partial = true;
         SetCollidable(uid, true, door, physics);
         door.NextStateChange = GameTiming.CurTime + door.CloseTimeTwo;
         Dirty(uid, door);