Expose zero-GC ClassicAPI aura access
This commit is contained in:
@@ -23,6 +23,9 @@ API.auras = type(_G.C_UnitAuras) == "table"
|
||||
and type(_G.C_UnitAuras.GetAuraDataByIndex) == "function"
|
||||
and type(_G.C_UnitAuras.GetDebuffDataByIndex) == "function"
|
||||
|
||||
API.aurapositional = type(_G.C_UnitAuras) == "table"
|
||||
and type(_G.C_UnitAuras.UnitDebuff) == "function"
|
||||
|
||||
API.spellinfo = type(_G.GetSpellInfo) == "function"
|
||||
|
||||
API.inventory = type(_G.C_Container) == "table"
|
||||
@@ -126,6 +129,14 @@ API.GetDebuffDataByIndex = function(unit, index)
|
||||
end
|
||||
end
|
||||
|
||||
-- ClassicAPI's positional UnitDebuff mirrors the Classic-Era 15-value shape
|
||||
-- without allocating an AuraData table. Prefer it in hot UI refresh paths.
|
||||
API.UnitDebuff = function(unit, index, filter)
|
||||
if API.aurapositional then
|
||||
return _G.C_UnitAuras.UnitDebuff(unit, index, filter)
|
||||
end
|
||||
end
|
||||
|
||||
API.GetCurrentChatGUID = function()
|
||||
if API.chatidentity then
|
||||
return _G.GetCurrentChatGUID()
|
||||
|
||||
Reference in New Issue
Block a user