oops acc wire broke (#14224)

* oops acc wire broke

* ensurecomp

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas
2023-02-22 19:37:41 +00:00
committed by GitHub
parent 9af2fe6512
commit 893081d784

View File

@@ -24,19 +24,19 @@ public sealed class AccessWireAction : ComponentWireAction<AccessReaderComponent
public override bool Cut(EntityUid user, Wire wire, AccessReaderComponent comp) public override bool Cut(EntityUid user, Wire wire, AccessReaderComponent comp)
{ {
WiresSystem.TryCancelWireAction(wire.Owner, PulseTimeoutKey.Key); WiresSystem.TryCancelWireAction(wire.Owner, PulseTimeoutKey.Key);
EntityManager.RemoveComponent<EmaggedComponent>(comp.Owner); EntityManager.EnsureComponent<EmaggedComponent>(comp.Owner);
return true; return true;
} }
public override bool Mend(EntityUid user, Wire wire, AccessReaderComponent comp) public override bool Mend(EntityUid user, Wire wire, AccessReaderComponent comp)
{ {
EntityManager.AddComponent<EmaggedComponent>(comp.Owner); EntityManager.RemoveComponent<EmaggedComponent>(comp.Owner);
return true; return true;
} }
public override void Pulse(EntityUid user, Wire wire, AccessReaderComponent comp) public override void Pulse(EntityUid user, Wire wire, AccessReaderComponent comp)
{ {
EntityManager.RemoveComponent<EmaggedComponent>(comp.Owner); EntityManager.EnsureComponent<EmaggedComponent>(comp.Owner);
WiresSystem.StartWireAction(wire.Owner, _pulseTimeout, PulseTimeoutKey.Key, new TimedWireEvent(AwaitPulseCancel, wire)); WiresSystem.StartWireAction(wire.Owner, _pulseTimeout, PulseTimeoutKey.Key, new TimedWireEvent(AwaitPulseCancel, wire));
} }