Merge pull request #1323 from DrSmugleaf/thrown-entity-deletion-crash-1286

Fix thrown entity deletion crash
This commit is contained in:
Víctor Aguilera Puerto
2020-07-09 00:16:43 +02:00
committed by GitHub

View File

@@ -1,6 +1,5 @@
using Content.Server.GameObjects.Components.Projectiles; using Content.Server.GameObjects.Components.Projectiles;
using Content.Server.GameObjects.EntitySystems.Click; using Content.Server.GameObjects.EntitySystems.Click;
using Content.Server.Interfaces.GameObjects.Components.Interaction;
using Content.Shared.GameObjects; using Content.Shared.GameObjects;
using Content.Shared.Physics; using Content.Shared.Physics;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
@@ -49,6 +48,11 @@ namespace Content.Server.GameObjects.Components
private void StopThrow() private void StopThrow()
{ {
if (Deleted)
{
return;
}
if (Owner.TryGetComponent(out CollidableComponent body) && body.PhysicsShapes.Count >= 1) if (Owner.TryGetComponent(out CollidableComponent body) && body.PhysicsShapes.Count >= 1)
{ {
body.PhysicsShapes[0].CollisionMask &= (int) ~CollisionGroup.ThrownItem; body.PhysicsShapes[0].CollisionMask &= (int) ~CollisionGroup.ThrownItem;