Don't allocate door crushes unless necessary (#13394)

This commit is contained in:
metalgearsloth
2023-01-10 22:57:49 +11:00
committed by GitHub
parent c8292ccbfc
commit 50ba8d968d

View File

@@ -108,7 +108,11 @@ public abstract class SharedDoorSystem : EntitySystem
if (args.Current is not DoorComponentState state)
return;
door.CurrentlyCrushing = new(state.CurrentlyCrushing);
if (!door.CurrentlyCrushing.Equals(state.CurrentlyCrushing))
{
door.CurrentlyCrushing = new(state.CurrentlyCrushing);
}
door.State = state.DoorState;
door.NextStateChange = state.NextStateChange;
door.Partial = state.Partial;