From 62cf5730e284f0e06e2c78e36c278ae1247f1409 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 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Content.Server/Wires/ComponentWireAction.cs b/Content.Server/Wires/ComponentWireAction.cs index 91c0748672..90c8a7594d 100644 --- a/Content.Server/Wires/ComponentWireAction.cs +++ b/Content.Server/Wires/ComponentWireAction.cs @@ -21,14 +21,15 @@ public abstract partial class ComponentWireAction : BaseWireAction w public override bool Cut(EntityUid user, Wire wire) { - return base.Cut(user, wire) && - EntityManager.TryGetComponent(wire.Owner, out TComponent? component) && Cut(user, wire, component); // Nyanotrasen - Tactical hacking + base.Cut(user, wire); + // 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) { - return base.Mend(user, wire) && - EntityManager.TryGetComponent(wire.Owner, out TComponent? component) && Mend(user, wire, component); // Nyanotrasen - Tactical hacking + base.Mend(user, wire); + return EntityManager.TryGetComponent(wire.Owner, out TComponent? component) ? Mend(user, wire, component) : true; } public override void Pulse(EntityUid user, Wire wire)