From 176347d15521ad0a62d76398c312480c216b8a06 Mon Sep 17 00:00:00 2001 From: pepopo978 Date: Sun, 23 Mar 2025 08:52:06 -0700 Subject: [PATCH] return whether cast occurred for use in macros --- commands.lua | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/commands.lua b/commands.lua index 94d1f9d..82f765d 100644 --- a/commands.lua +++ b/commands.lua @@ -449,7 +449,7 @@ end function Cursive:Curse(spellName, targetedGuid, options) if not spellName or not targetedGuid then DEFAULT_CHAT_FRAME:AddMessage(commands["curse"]) - return + return false end if targetedGuid and string.sub(targetedGuid, 1, 2) ~= "0x" then @@ -459,7 +459,7 @@ function Cursive:Curse(spellName, targetedGuid, options) if options["warnings"] then DEFAULT_CHAT_FRAME:AddMessage(curseNoTarget) end - return + return false end end @@ -469,7 +469,7 @@ function Cursive:Curse(spellName, targetedGuid, options) if options["warnings"] then DEFAULT_CHAT_FRAME:AddMessage(curseNoTarget) end - return + return false end end @@ -478,9 +478,12 @@ function Cursive:Curse(spellName, targetedGuid, options) if targetedGuid and not Cursive.curses:HasCurse(spellNameNoRank, targetedGuid, options["refreshtime"]) and not isMobCrowdControlled(targetedGuid) then castSpellWithOptions(string.lower(spellName), spellNameNoRank, targetedGuid, options) + return true elseif options["warnings"] then DEFAULT_CHAT_FRAME:AddMessage(curseNoTarget) end + + return false end local function getSpellTarget(spellName, priority, options) @@ -510,16 +513,20 @@ function Cursive:Multicurse(spellName, priority, options) if targetedGuid then local spellNameNoRank = string.lower(string.gsub(spellName, "%(.+%)", "")) castSpellWithOptions(string.lower(spellName), spellNameNoRank, targetedGuid, options) + return true elseif options["warnings"] then DEFAULT_CHAT_FRAME:AddMessage(curseNoTarget) end + return false end function Cursive:Target(spellName, priority, options) local targetedGuid = getSpellTarget(spellName, priority, options) if targetedGuid then TargetUnit(targetedGuid) + return true end + return false end SLASH_CURSIVE1 = "/cursive" --creating the slash command