Fix airlock crush (#2348)
Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
This commit is contained in:
@@ -378,12 +378,17 @@ namespace Content.Server.GameObjects.Components.Doors
|
|||||||
public bool Close()
|
public bool Close()
|
||||||
{
|
{
|
||||||
bool shouldCheckCrush = false;
|
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))
|
physics.IsColliding(Vector2.Zero, false))
|
||||||
{
|
{
|
||||||
if (Safety)
|
if (Safety)
|
||||||
|
{
|
||||||
|
physics.CanCollide = false;
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// check if we crush someone while closing
|
// check if we crush someone while closing
|
||||||
shouldCheckCrush = true;
|
shouldCheckCrush = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user