From 97e898f14c4571e5c9457d555019402badfe8f8b Mon Sep 17 00:00:00 2001 From: Brues <5278969+brues-code@users.noreply.github.com> Date: Sun, 19 Jul 2026 14:32:13 -0500 Subject: [PATCH] Add /cancelform command and CancelShapeshiftForm Adds a new /cancelform slash command (Console.lua) wired to CleveRoids.DoCancelForm. Replaces the previous _unshiftAction with _cancelFormAction that calls CancelShapeshiftForm, and updates DoUnshift to delegate to DoCancelForm for backwards compatibility. Also fixes a unit name check by replacing GetUnitName with UnitName in DoRetarget. --- Console.lua | 4 ++++ Core.lua | 17 ++++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Console.lua b/Console.lua index 57132c9..ed99624 100644 --- a/Console.lua +++ b/Console.lua @@ -67,6 +67,10 @@ SLASH_UNSHIFT1 = "/unshift" SlashCmdList.UNSHIFT = CleveRoids.DoUnshift +SLASH_CANCELFORM1 = "/cancelform" + +SlashCmdList.CANCELFORM = CleveRoids.DoCancelForm + SLASH_UNQUEUE1 = "/unqueue" SlashCmdList.UNQUEUE = SpellStopCasting diff --git a/Core.lua b/Core.lua index 08fa5a7..996c739 100644 --- a/Core.lua +++ b/Core.lua @@ -3654,11 +3654,8 @@ local function _equipRing2Action(msg) return CleveRoids.EquipBagItem(msg, 12) end -local function _unshiftAction() - local currentShapeshiftIndex = CleveRoids.GetCurrentShapeshiftIndex() - if currentShapeshiftIndex ~= 0 then - CastShapeshiftForm(currentShapeshiftIndex) - end +local function _cancelFormAction() + CancelShapeshiftForm() end function CleveRoids.DoEquipMainhand(msg) @@ -3729,27 +3726,29 @@ function CleveRoids.DoEquipRing2(msg) return false end -function CleveRoids.DoUnshift(msg) +function CleveRoids.DoCancelForm(msg) local handled -- PERFORMANCE: Use numeric iteration to avoid pairs() iterator allocation local parts = CleveRoids.splitStringIgnoringQuotes(msg) for i = 1, table.getn(parts) do handled = false - if CleveRoids.DoWithConditionals(parts[i], _unshiftAction, CleveRoids.FixEmptyTarget, false, _unshiftAction) then + if CleveRoids.DoWithConditionals(parts[i], _cancelFormAction, CleveRoids.FixEmptyTarget, false, _cancelFormAction) then handled = true break end end if handled == nil then - _unshiftAction() + _cancelFormAction() end return handled end +CleveRoids.DoUnshift = CleveRoids.DoCancelForm + function CleveRoids.DoRetarget() - if GetUnitName("target") == nil + if UnitName("target") == nil or UnitHealth("target") == 0 or not UnitCanAttack("player", "target") then