mirror of
https://github.com/brues-code/SuperCleveRoidMacros.git
synced 2026-09-16 03:38:00 +00:00
fix range on self cast spells
This commit is contained in:
+11
-1
@@ -1544,10 +1544,20 @@ function API.IsSpellInRange(spellIdentifier, unit)
|
||||
local result = IsSpellInRange(checkValue, unit)
|
||||
-- result == 1 (in range), 0 (out of range), -1 (invalid/non-unit-targeted), nil (error)
|
||||
-- Only use native result for definitive answers (0 or 1)
|
||||
-- Fall through to UnitXP fallback for -1 (ground-targeted spells like Blizzard)
|
||||
if result == 0 or result == 1 then
|
||||
return result
|
||||
end
|
||||
|
||||
-- For -1 (non-unit-targeted), check if it's a self-only spell
|
||||
-- Self-targeted spells (rangeIndex 0) should always be considered in range
|
||||
if result == -1 and spellId and spellId > 0 then
|
||||
local rangeIndex = API.GetSpellField(spellId, "rangeIndex")
|
||||
-- rangeIndex 0 = Self Only, 14 = Self Only (alternate), 23 = Touch
|
||||
if rangeIndex == 0 or rangeIndex == 14 or rangeIndex == 23 then
|
||||
return 1 -- Self-targeted spells are always in range
|
||||
end
|
||||
-- For other -1 cases (ground-targeted like Blizzard), fall through to UnitXP
|
||||
end
|
||||
end
|
||||
|
||||
-- Fallback: Use spell range from record + UnitXP distance check
|
||||
|
||||
Reference in New Issue
Block a user