From 80d733a15211ca96a2668dba009965638ef490b4 Mon Sep 17 00:00:00 2001 From: Andrew Malcolm O'Neill <105134723+maland1@users.noreply.github.com> Date: Wed, 2 Jul 2025 21:50:22 +0100 Subject: [PATCH] Resolving Wizard casting recall on nuke disk making it impossible to disarm (#38661) * Resolving Wizard Recall on Nuke disk making it impossible to disarm - Adding a DisarmBomb case to nuke status update loop - Changing a few methods and parameters to properly follow formatting standards - Updating some names to follow camelCase * Updating missed tag * Reverting DataField change Should prevent this preventative bugfix being a breaking change. --- Content.Server/Nuke/NukeComponent.cs | 2 +- Content.Server/Nuke/NukeSystem.cs | 25 ++++++++++++++++--------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/Content.Server/Nuke/NukeComponent.cs b/Content.Server/Nuke/NukeComponent.cs index b14ad9c165..cd1c0227eb 100644 --- a/Content.Server/Nuke/NukeComponent.cs +++ b/Content.Server/Nuke/NukeComponent.cs @@ -56,7 +56,7 @@ namespace Content.Server.Nuke /// How long a user must wait to disarm the bomb. /// [DataField("disarmDoafterLength")] - public float DisarmDoafterLength = 30.0f; + public float DisarmDoAfterLength = 30.0f; [DataField("alertLevelOnActivate")] public string AlertLevelOnActivate = default!; [DataField("alertLevelOnDeactivate")] public string AlertLevelOnDeactivate = default!; diff --git a/Content.Server/Nuke/NukeSystem.cs b/Content.Server/Nuke/NukeSystem.cs index 81fbf074da..f110734a60 100644 --- a/Content.Server/Nuke/NukeSystem.cs +++ b/Content.Server/Nuke/NukeSystem.cs @@ -165,7 +165,7 @@ public sealed class NukeSystem : EntitySystem { UpdateUserInterface(uid, component); - if (args.Anchored == false && component.Status == NukeStatus.ARMED && component.RemainingTime > component.DisarmDoafterLength) + if (args.Anchored == false && component.Status == NukeStatus.ARMED && component.RemainingTime > component.DisarmDoAfterLength) { // yes, this means technically if you can find a way to unanchor the nuke, you can disarm it // without the doafter. but that takes some effort, and it won't allow you to disarm a nuke that can't be disarmed by the doafter. @@ -271,7 +271,7 @@ public sealed class NukeSystem : EntitySystem else { - DisarmBombDoafter(uid, args.Actor, component); + DisarmBombDoAfter(uid, args.Actor, component); } } @@ -381,7 +381,12 @@ public sealed class NukeSystem : EntitySystem // do nothing, wait for arm button to be pressed break; case NukeStatus.ARMED: - // do nothing, wait for arm button to be unpressed + // handling case of wizard recalling disk out of armed Nuke + if (!component.DiskSlot.HasItem) + { + DisarmBomb(uid, component); + } + break; } } @@ -409,7 +414,7 @@ public sealed class NukeSystem : EntitySystem AllowArm = allowArm, EnteredCodeLength = component.EnteredCode.Length, MaxCodeLength = component.CodeLength, - CooldownTime = (int) component.CooldownTime + CooldownTime = (int) component.CooldownTime, }; _ui.SetUiState(uid, NukeUiKey.Key, state); @@ -436,7 +441,7 @@ public sealed class NukeSystem : EntitySystem 8 => 9, 9 => 10, 0 => component.LastPlayedKeypadSemitones + 12, - _ => 0 + _ => 0, }; // Don't double-dip on the octave shifting @@ -617,9 +622,9 @@ public sealed class NukeSystem : EntitySystem #endregion - private void DisarmBombDoafter(EntityUid uid, EntityUid user, NukeComponent nuke) + private void DisarmBombDoAfter(EntityUid uid, EntityUid user, NukeComponent nuke) { - var doAfter = new DoAfterArgs(EntityManager, user, nuke.DisarmDoafterLength, new NukeDisarmDoAfterEvent(), uid, target: uid) + var doAfter = new DoAfterArgs(EntityManager, user, nuke.DisarmDoAfterLength, new NukeDisarmDoAfterEvent(), uid, target: uid) { BreakOnDamage = true, BreakOnMove = true, @@ -629,8 +634,10 @@ public sealed class NukeSystem : EntitySystem if (!_doAfter.TryStartDoAfter(doAfter)) return; - _popups.PopupEntity(Loc.GetString("nuke-component-doafter-warning"), user, - user, PopupType.LargeCaution); + _popups.PopupEntity(Loc.GetString("nuke-component-doafter-warning"), + user, + user, + PopupType.LargeCaution); } private void UpdateAppearance(EntityUid uid, NukeComponent nuke)