From 314d89e30d1a93a5677f9d7d84c62433aed7b4d1 Mon Sep 17 00:00:00 2001 From: Brues <5278969+brues-code@users.noreply.github.com> Date: Thu, 21 May 2026 16:47:53 -0500 Subject: [PATCH] librange.GetRangeSlot via GetActionInfo + GetMacroSpell MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaces the texture-from-action + "no macro text" heuristic with a proper resolve-to-spellID step. Macros that cast a 40y heal but display a non-spell icon (custom macro icon, /castsequence wrappers, etc.) now match correctly — the previous code missed them because GetActionTexture returns the macro's icon, not the underlying spell's. C_Spell.GetSpellTexture(spellID) returns the spell's intrinsic icon path, which is what the class-spell table is keyed on, so the texture-comparison logic is unchanged. --- libs/librange.lua | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/libs/librange.lua b/libs/librange.lua index 5fcd8b14..ef3ef5c7 100644 --- a/libs/librange.lua +++ b/libs/librange.lua @@ -135,10 +135,24 @@ end function librange:GetRangeSlot() if not spells[class] then return nil end for i=1,120 do - local texture = GetActionTexture(i) - if texture and not GetActionText(i) then - for _, check in pairs(spells[class]) do - if check == texture then return i end + -- Resolve the slot to a spellID for both spell and macro actions; the old + -- `not GetActionText` macro-filter missed macros that cast a 40y heal but + -- displayed a non-spell icon. C_Spell.GetSpellTexture(spellID) gives the + -- spell's *intrinsic* icon, which is what we match against. + local kind, id = GetActionInfo(i) + local spellID + if kind == "spell" then + spellID = id + elseif kind == "macro" then + local _, _, sid = GetMacroSpell(id) + spellID = sid + end + if spellID then + local texture = C_Spell.GetSpellTexture(spellID) + if texture then + for _, check in pairs(spells[class]) do + if check == texture then return i end + end end end end