Fix door animations mispredicting if closing is interrupted (#33481)

* 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
This commit is contained in:
metalgearsloth
2024-11-23 20:31:07 +11:00
committed by GitHub
parent bdf4a46edf
commit c3786a56dc

View File

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