Fix thrown entity deletion crash

This commit is contained in:
DrSmugleaf
2020-07-08 16:39:05 +02:00
parent e815de7563
commit ecb0448250

View File

@@ -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.GameObjects.EntitySystems.Click;
using Content.Server.Interfaces.GameObjects.Components.Interaction; using Content.Server.Interfaces.GameObjects.Components.Interaction;
using Content.Shared.GameObjects; using Content.Shared.GameObjects;
@@ -49,6 +49,11 @@ namespace Content.Server.GameObjects.Components
private void StopThrow() private void StopThrow()
{ {
if (Owner.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;