From 50ba8d968d413b2b1ac892fe56732ae7386a084a Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Tue, 10 Jan 2023 22:57:49 +1100 Subject: [PATCH] Don't allocate door crushes unless necessary (#13394) --- Content.Shared/Doors/Systems/SharedDoorSystem.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Content.Shared/Doors/Systems/SharedDoorSystem.cs b/Content.Shared/Doors/Systems/SharedDoorSystem.cs index c25b8933f7..51eb160e20 100644 --- a/Content.Shared/Doors/Systems/SharedDoorSystem.cs +++ b/Content.Shared/Doors/Systems/SharedDoorSystem.cs @@ -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;