From c70066aedef73b7b72ea442bb9d76e961d459029 Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Wed, 21 Oct 2020 19:22:38 +1100 Subject: [PATCH] Fix airlock crush (#2348) Co-authored-by: Metal Gear Sloth --- .../GameObjects/Components/Doors/ServerDoorComponent.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Content.Server/GameObjects/Components/Doors/ServerDoorComponent.cs b/Content.Server/GameObjects/Components/Doors/ServerDoorComponent.cs index 548719e6ea..2306b8e112 100644 --- a/Content.Server/GameObjects/Components/Doors/ServerDoorComponent.cs +++ b/Content.Server/GameObjects/Components/Doors/ServerDoorComponent.cs @@ -378,12 +378,17 @@ namespace Content.Server.GameObjects.Components.Doors public bool Close() { bool shouldCheckCrush = false; + if (Owner.TryGetComponent(out IPhysicsComponent? physics)) + physics.CanCollide = true; - if (_canCrush && Owner.TryGetComponent(out IPhysicsComponent? physics) && + if (_canCrush && physics != null && physics.IsColliding(Vector2.Zero, false)) { if (Safety) + { + physics.CanCollide = false; return false; + } // check if we crush someone while closing shouldCheckCrush = true;