libdebuff: use proper invocation of UnitDebuff

This commit is contained in:
shagu
2018-09-30 14:16:51 +02:00
parent ec9be68fda
commit 7ecb7d5411
3 changed files with 15 additions and 8 deletions
+3 -3
View File
@@ -145,16 +145,16 @@ libdebuff:SetScript("OnEvent", function()
for unit, effect in gfind(arg1, libdebuff.combatlog) do
local unitlevel = UnitName("target") == unit and UnitLevel("target") or 0
if not libdebuff.objects[unit] or not libdebuff.objects[unit][unitlevel] or not libdebuff.objects[unit][unitlevel][effect] then
this:AddEffect(unit, unitlevel, effect)
libdebuff:AddEffect(unit, unitlevel, effect)
end
end
-- Add Missing Buffs by Iteration
elseif ( event == "UNIT_AURA" and arg1 == "target" ) or event == "PLAYER_TARGET_CHANGED" then
for i=1, 16 do
effect, rank, texture, stacks, dtype, duration, timeleft = this:UnitDebuff("target", i)
effect, rank, texture, stacks, dtype, duration, timeleft = libdebuff:UnitDebuff("target", i)
if texture and effect and duration then
this:AddEffect(UnitName("target"), UnitLevel("target"), effect)
libdebuff:AddEffect(UnitName("target"), UnitLevel("target"), effect)
end
end