From 869d1a404bb81b86a4ef9021ee3c84b816ae2223 Mon Sep 17 00:00:00 2001 From: Jrc13245 Date: Sun, 7 Dec 2025 21:53:41 -0500 Subject: [PATCH] fix mouseover casting for users not using an updated nampower --- NampowerAPI.lua | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/NampowerAPI.lua b/NampowerAPI.lua index 5212809..8f68306 100644 --- a/NampowerAPI.lua +++ b/NampowerAPI.lua @@ -1024,13 +1024,32 @@ function API.SmartCast(spellName, target, forceQueue, forceNoQueue) useQueue = API.IsSpellQueueingEnabled(spellName) end + -- Check if we have a non-standard target (e.g., @mouseover) + -- QueueSpellByName in older Nampower versions doesn't support target parameter + -- Only Nampower v2.13+ supports QueueSpellByName with target + local hasNonStandardTarget = target and target ~= "target" + local canQueueWithTarget = API.HasMinimumVersion(2, 13, 0) + -- Cast the spell if useQueue and QueueSpellByName then - -- Use Nampower's queue system - QueueSpellByName(spellName) - return true - elseif CastSpellByName then - -- Use standard casting + if hasNonStandardTarget then + if canQueueWithTarget then + -- Nampower v2.13+ supports target parameter in QueueSpellByName + QueueSpellByName(spellName, target) + return true + else + -- Older Nampower: can't queue with non-standard target + -- Fall through to CastSpellByName with target + end + else + -- No target or target is "target" - safe to use queue + QueueSpellByName(spellName) + return true + end + end + + -- Use standard casting (either queuing wasn't possible or we need target support) + if CastSpellByName then if target and CleveRoids.hasSuperwow then -- SuperWoW supports target parameter CastSpellByName(spellName, target)