Resolve tracked aura texture/stacks via C_UnitAuras, not slot scans

FindPlayerDebuff and FindPlayerBuff hand-scanned debuff/buff slots for a
spellID to pull icon + stacks. Both now use ClassicAPI.GetUnitAuraBySpellID
(AuraData.icon / .applications) -- FindPlayerDebuff unfiltered (walks both
ranges, was debuff-then-buff), FindPlayerBuff HELPFUL-filtered (buff-only).
Search order is immaterial since a spellID is only ever a buff or a debuff.
This commit is contained in:
Brues
2026-07-28 09:20:23 -05:00
parent da8ea22998
commit 37434911e4
+11 -34
View File
@@ -2441,31 +2441,13 @@ function lib:FindPlayerDebuff(unit, spellID)
return nil
end
-- Find the texture by searching debuff and buff slots
-- Find the texture/stacks via one by-ID lookup (walks both debuff and buff
-- ranges), replacing the 16 debuff + 32 buff slot scan.
local texture, stacks = nil, rec.stacks
-- Search debuff slots first
for i = 1, 16 do
local tex, st, dtype, sid = UnitDebuff(unit, i)
if not tex then break end
if sid == spellID then
texture = tex
stacks = st or stacks
break
end
end
-- If not found in debuffs, search buff slots
if not texture then
for i = 1, 32 do
local tex, st, sid = UnitBuff(unit, i)
if not tex then break end
if sid == spellID then
texture = tex
stacks = st or stacks
break
end
end
local aura = CleveRoids.ClassicAPI.GetUnitAuraBySpellID(unit, spellID)
if aura then
texture = aura.icon
stacks = aura.applications or stacks
end
if not texture then return nil end
@@ -2493,17 +2475,12 @@ function lib:FindPlayerBuff(unit, spellID)
return nil
end
-- Find the texture by searching buff slots only
-- Find the texture/stacks via one by-ID lookup restricted to buffs.
local texture, stacks = nil, rec.stacks
for i = 1, 32 do
local tex, st, sid = UnitBuff(unit, i)
if not tex then break end
if sid == spellID then
texture = tex
stacks = st or stacks
break
end
local aura = CleveRoids.ClassicAPI.GetUnitAuraBySpellID(unit, spellID, "HELPFUL")
if aura then
texture = aura.icon
stacks = aura.applications or stacks
end
if not texture then return nil end