Fetch the totem buff icon via GetBuffDataByIndex

Use C_UnitAuras.GetBuffDataByIndex(guid, 1) instead of GetUnitAuras(guid)[1]:
a passive totem's provided buff is its single helpful aura, so the buff-
filtered single-slot fetch is both more precise and cheaper than building the
full aura list to take the first entry.
This commit is contained in:
Brues
2026-08-09 03:39:11 -05:00
parent 25ef02705c
commit 97ef039d3a
+2 -2
View File
@@ -306,8 +306,8 @@ pfUI:RegisterModule("nameplates", function ()
if C.nameplates.totemicons ~= "1" then return nil end
if CreatureType(plate) ~= 11 then return nil end
if plate.totemIcon then return plate.totemIcon end
local auras = C_UnitAuras.GetUnitAuras(plate.cachedGuid)
if auras and auras[1] then plate.totemIcon = auras[1].icon end
local aura = C_UnitAuras.GetBuffDataByIndex(plate.cachedGuid, 1)
if aura then plate.totemIcon = aura.icon end
return plate.totemIcon
end