libdebuff: emulate UnitDebuff API call

This commit is contained in:
shagu
2018-09-30 13:42:46 +02:00
parent 6a315f9e41
commit 2c66e5c0c2
3 changed files with 48 additions and 57 deletions
+4 -3
View File
@@ -1138,9 +1138,10 @@ function pfUI.uf:RefreshUnit(unit, component)
local timeleft = GetPlayerBuffTimeLeft(GetPlayerBuff(unit.debuffs[i]:GetID() - 1, "HARMFUL"),"HARMFUL")
CooldownFrame_SetTimer(unit.debuffs[i].cd, GetTime(), timeleft, 1)
elseif libdebuff then
local effect = libdebuff:GetDebuffName(unitstr, unit.debuffs[i]:GetID())
local start, duration, timeleft = libdebuff:GetDebuffInfo(unitstr, effect)
CooldownFrame_SetTimer(unit.debuffs[i].cd, start, duration, 1)
local name, rank, texture, stacks, dtype, duration, timeleft = libdebuff:UnitDebuff(unitstr, i)
if duration and timeleft then
CooldownFrame_SetTimer(unit.debuffs[i].cd, GetTime() + timeleft - duration, duration, 1)
end
end
if stacks > 1 then