mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-21 23:26:56 +00:00
unitframes/buffwatch/libpredict: route aura reads through C_UnitAuras
ClassicAPI's recent C_UnitAuras additions (sourceUnit / sourceGUID / non-player expirationTime / the PLAYER filter token) finally cover everything libdebuff:UnitDebuff and :UnitOwnDebuff were doing — caster attribution, accurate timing for non-player units, and the own-debuffs filter. Migrating the remaining callers off the libdebuff readers. - api/unitframes.lua: collapses the debuff render path's three-branch if/else into a single C_UnitAuras.GetAuraDataByIndex with a HARMFUL or HARMFUL|PLAYER filter selected by the selfdebuff config; tooltip slot-finders match by sourceGUID instead of libdebuff's caster flag; custom-debuff indicator scan unifies the same way. - modules/buffwatch.lua: GetBuffData drops the libdebuff fallback; tooltip slot-finder mirrors the unitframes pattern. - libs/libpredict.lua: drops the orphaned UnitHasBuff slot-loop (no callers left). - api/api.lua: pfUI.api.UnitHasBuff tightens from a HELPFUL iteration to a single GetAuraDataBySpellName lookup. Each site that builds a cooldown ring from expirationTime carries the talent-extension guard — when expirationTime exceeds the dbc base duration (e.g. Shadow Affinity → SW:P), clamp start to now and use the remaining time as the effective duration so CooldownFrame_SetTimer doesn't get a future start it treats as "not yet begun".
This commit is contained in:
+1
-4
@@ -193,10 +193,7 @@ end
|
||||
-- name [string] The localized name of the buff.
|
||||
-- return: [bool] true if unit has buff otherwise "nil"
|
||||
function pfUI.api.UnitHasBuff(unit, name)
|
||||
for _, aura in ipairs(C_UnitAuras.GetUnitAuras(unit, "HELPFUL")) do
|
||||
if aura.name == name then return true end
|
||||
end
|
||||
return nil
|
||||
return C_UnitAuras.GetAuraDataBySpellName(unit, name, "HELPFUL") ~= nil or nil
|
||||
end
|
||||
|
||||
-- [ GetUnbuffedRoster ]
|
||||
|
||||
Reference in New Issue
Block a user