diff --git a/Content.Server/GameObjects/Components/Power/PowerTransferComponent.cs b/Content.Server/GameObjects/Components/Power/PowerTransferComponent.cs index 79771febfa..d9764afafb 100644 --- a/Content.Server/GameObjects/Components/Power/PowerTransferComponent.cs +++ b/Content.Server/GameObjects/Components/Power/PowerTransferComponent.cs @@ -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(out var stackComp)) + stackComp.Count = 1; + return true; } return false; diff --git a/Content.Server/GameObjects/Components/Projectiles/ProjectileComponent.cs b/Content.Server/GameObjects/Components/Projectiles/ProjectileComponent.cs index f0e1a82ea0..589b7c2efc 100644 --- a/Content.Server/GameObjects/Components/Projectiles/ProjectileComponent.cs +++ b/Content.Server/GameObjects/Components/Projectiles/ProjectileComponent.cs @@ -77,7 +77,7 @@ namespace Content.Server.GameObjects.Components.Projectiles } } - if (entity.TryGetComponent(out CameraRecoilComponent recoilComponent) + if (!entity.Deleted && entity.TryGetComponent(out CameraRecoilComponent recoilComponent) && Owner.TryGetComponent(out PhysicsComponent physicsComponent)) { var direction = physicsComponent.LinearVelocity.Normalized; diff --git a/Resources/Prototypes/Entities/buildings/power.yml b/Resources/Prototypes/Entities/buildings/power.yml index 07ad94665e..4fa6a28b7c 100644 --- a/Resources/Prototypes/Entities/buildings/power.yml +++ b/Resources/Prototypes/Entities/buildings/power.yml @@ -22,6 +22,9 @@ key: power_cables mode: CardinalFlags - type: SubFloorHide + - type: Destructible + thresholdvalue: 100 + spawnondestroy: CableStack snap: - Wire