Wires are now broken in explosions, and drop cables.
Using the wire cutters on a wire drops a cable. Fix bug where bullets raise an exception when the hit object deletes itself.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.Linq;
|
||||
using Content.Server.GameObjects.Components.Interactable.Tools;
|
||||
using Content.Server.GameObjects.Components.Stack;
|
||||
using Content.Server.GameObjects.EntitySystems;
|
||||
using Robust.Server.Interfaces.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
@@ -137,6 +138,11 @@ namespace Content.Server.GameObjects.Components.Power
|
||||
if (eventArgs.AttackWith.TryGetComponent(out WirecutterComponent wirecutter))
|
||||
{
|
||||
Owner.Delete();
|
||||
var droppedEnt = Owner.EntityManager.SpawnEntityAt("CableStack", eventArgs.ClickLocation);
|
||||
|
||||
if (droppedEnt.TryGetComponent<StackComponent>(out var stackComp))
|
||||
stackComp.Count = 1;
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user