diff --git a/Content.Server/Atmos/Monitor/Systems/FireAlarmSystem.cs b/Content.Server/Atmos/Monitor/Systems/FireAlarmSystem.cs index e0fd89cce0d..6d768c12926 100644 --- a/Content.Server/Atmos/Monitor/Systems/FireAlarmSystem.cs +++ b/Content.Server/Atmos/Monitor/Systems/FireAlarmSystem.cs @@ -30,7 +30,6 @@ public override void Initialize() { SubscribeLocalEvent(OnInteractHand); SubscribeLocalEvent(OnDeviceListSync); - SubscribeLocalEvent(OnAttemptEmag); SubscribeLocalEvent(OnEmagged); } @@ -77,25 +76,20 @@ private void OnInteractHand(EntityUid uid, FireAlarmComponent component, Interac } } - private void OnAttemptEmag(EntityUid uid, FireAlarmComponent component, ref OnAttemptEmagEvent args) + private void OnEmagged(EntityUid uid, FireAlarmComponent component, ref GotEmaggedEvent args) { - if (args.Type != EmagType.Interaction) - { - args.Handled = true; + if (!_emag.CompareFlag(args.Type, EmagType.Interaction)) return; - } if (_emag.CheckFlag(uid, EmagType.Interaction)) - args.Handled = true; - } + return; - private void OnEmagged(EntityUid uid, FireAlarmComponent component, ref GotEmaggedEvent args) - { - if (TryComp(uid, out var alarmable)) - { - // Remove the atmos alarmable component permanently from this device. - _atmosAlarmable.ForceAlert(uid, AtmosAlarmType.Emagged, alarmable); - RemCompDeferred(uid); - } + if (!TryComp(uid, out var alarmable)) + return; + + // Remove the atmos alarmable component permanently from this device. + _atmosAlarmable.ForceAlert(uid, AtmosAlarmType.Emagged, alarmable); + RemCompDeferred(uid); + args.Handled = true; } } diff --git a/Content.Server/Cloning/CloningSystem.cs b/Content.Server/Cloning/CloningSystem.cs index 23d1f410dd9..0e149b42622 100644 --- a/Content.Server/Cloning/CloningSystem.cs +++ b/Content.Server/Cloning/CloningSystem.cs @@ -75,7 +75,6 @@ public override void Initialize() SubscribeLocalEvent(OnPortDisconnected); SubscribeLocalEvent(OnAnchor); SubscribeLocalEvent(OnExamined); - SubscribeLocalEvent(OnAttemptEmag); SubscribeLocalEvent(OnEmagged); } @@ -290,6 +289,12 @@ private void OnAttemptEmag(EntityUid uid, CloningPodComponent clonePod, ref OnAt /// private void OnEmagged(EntityUid uid, CloningPodComponent clonePod, ref GotEmaggedEvent args) { + if (!_emag.CompareFlag(args.Type, EmagType.Interaction)) + return; + + if (_emag.CheckFlag(uid, EmagType.Interaction)) + return; + if (!this.IsPowered(uid, EntityManager)) return;