From 855547a2d4ea6f95f1b1db7d62a586a57a54f712 Mon Sep 17 00:00:00 2001 From: goet <6637097+goet@users.noreply.github.com> Date: Sat, 23 Nov 2024 12:41:37 +0100 Subject: [PATCH] Ensure wires can always be cut (#32447) ensure wires are always cut --- Content.Server/Wires/ComponentWireAction.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Content.Server/Wires/ComponentWireAction.cs b/Content.Server/Wires/ComponentWireAction.cs index 2407068056..90c8a7594d 100644 --- a/Content.Server/Wires/ComponentWireAction.cs +++ b/Content.Server/Wires/ComponentWireAction.cs @@ -22,13 +22,14 @@ public abstract partial class ComponentWireAction : BaseWireAction w public override bool Cut(EntityUid user, Wire wire) { base.Cut(user, wire); - return EntityManager.TryGetComponent(wire.Owner, out TComponent? component) && Cut(user, wire, component); + // if the entity doesn't exist, we need to return true otherwise the wire sprite is never updated + return EntityManager.TryGetComponent(wire.Owner, out TComponent? component) ? Cut(user, wire, component) : true; } public override bool Mend(EntityUid user, Wire wire) { base.Mend(user, wire); - return EntityManager.TryGetComponent(wire.Owner, out TComponent? component) && Mend(user, wire, component); + return EntityManager.TryGetComponent(wire.Owner, out TComponent? component) ? Mend(user, wire, component) : true; } public override void Pulse(EntityUid user, Wire wire)