]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
oops acc wire broke (#14224)
authordeltanedas <39013340+deltanedas@users.noreply.github.com>
Wed, 22 Feb 2023 19:37:41 +0000 (19:37 +0000)
committerGitHub <noreply@github.com>
Wed, 22 Feb 2023 19:37:41 +0000 (11:37 -0800)
* oops acc wire broke

* ensurecomp

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
Content.Server/Access/AccessWireAction.cs

index 8592febf239413ca663d238845f9a8fef77cc600..05ec8ace77c85712c25196786280499b85f1d425 100644 (file)
@@ -24,19 +24,19 @@ public sealed class AccessWireAction : ComponentWireAction<AccessReaderComponent
     public override bool Cut(EntityUid user, Wire wire, AccessReaderComponent comp)
     {
         WiresSystem.TryCancelWireAction(wire.Owner, PulseTimeoutKey.Key);
-        EntityManager.RemoveComponent<EmaggedComponent>(comp.Owner);
+        EntityManager.EnsureComponent<EmaggedComponent>(comp.Owner);
         return true;
     }
 
     public override bool Mend(EntityUid user, Wire wire, AccessReaderComponent comp)
     {
-        EntityManager.AddComponent<EmaggedComponent>(comp.Owner);
+        EntityManager.RemoveComponent<EmaggedComponent>(comp.Owner);
         return true;
     }
 
     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));
     }