Skip to content

Commit

Permalink
Ensure wires can always be cut (#32447)
Browse files Browse the repository at this point in the history
ensure wires are always cut
  • Loading branch information
goet authored Nov 23, 2024
1 parent 45af6a1 commit 855547a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Content.Server/Wires/ComponentWireAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ public abstract partial class ComponentWireAction<TComponent> : 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)
Expand Down

0 comments on commit 855547a

Please sign in to comment.