From ecb044825003f377dc49ec59eca222d796a40dd6 Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Wed, 8 Jul 2020 16:39:05 +0200 Subject: [PATCH] Fix thrown entity deletion crash --- .../Components/Projectiles/ThrownItemComponent.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Content.Server/GameObjects/Components/Projectiles/ThrownItemComponent.cs b/Content.Server/GameObjects/Components/Projectiles/ThrownItemComponent.cs index 357724ba53..53f93e85bb 100644 --- a/Content.Server/GameObjects/Components/Projectiles/ThrownItemComponent.cs +++ b/Content.Server/GameObjects/Components/Projectiles/ThrownItemComponent.cs @@ -1,4 +1,4 @@ -using Content.Server.GameObjects.Components.Projectiles; +using Content.Server.GameObjects.Components.Projectiles; using Content.Server.GameObjects.EntitySystems.Click; using Content.Server.Interfaces.GameObjects.Components.Interaction; using Content.Shared.GameObjects; @@ -49,6 +49,11 @@ namespace Content.Server.GameObjects.Components private void StopThrow() { + if (Owner.Deleted) + { + return; + } + if (Owner.TryGetComponent(out CollidableComponent body) && body.PhysicsShapes.Count >= 1) { body.PhysicsShapes[0].CollisionMask &= (int) ~CollisionGroup.ThrownItem;