Don't allocate door crushes unless necessary (#13394)
This commit is contained in:
@@ -108,7 +108,11 @@ public abstract class SharedDoorSystem : EntitySystem
|
|||||||
if (args.Current is not DoorComponentState state)
|
if (args.Current is not DoorComponentState state)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
door.CurrentlyCrushing = new(state.CurrentlyCrushing);
|
if (!door.CurrentlyCrushing.Equals(state.CurrentlyCrushing))
|
||||||
|
{
|
||||||
|
door.CurrentlyCrushing = new(state.CurrentlyCrushing);
|
||||||
|
}
|
||||||
|
|
||||||
door.State = state.DoorState;
|
door.State = state.DoorState;
|
||||||
door.NextStateChange = state.NextStateChange;
|
door.NextStateChange = state.NextStateChange;
|
||||||
door.Partial = state.Partial;
|
door.Partial = state.Partial;
|
||||||
|
|||||||
Reference in New Issue
Block a user