From 3137cc9402e433c20675231ffd6c421e1966152c Mon Sep 17 00:00:00 2001 From: shagu Date: Tue, 9 Oct 2018 20:16:00 +0200 Subject: [PATCH] libdebuff: do not overwrite existing values --- libs/libdebuff.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libs/libdebuff.lua b/libs/libdebuff.lua index ef29a770..725d5f49 100644 --- a/libs/libdebuff.lua +++ b/libs/libdebuff.lua @@ -153,8 +153,14 @@ libdebuff:SetScript("OnEvent", function() 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 = libdebuff:UnitDebuff("target", i) - if texture and effect and duration then - libdebuff:AddEffect(UnitName("target"), UnitLevel("target"), effect) + + if texture and effect and effect ~= "" and duration then + -- don't overwrite existing timers + local unitlevel = UnitLevel("target") or 0 + local unit = UnitName("target") + if not libdebuff.objects[unit] or not libdebuff.objects[unit][unitlevel] or not libdebuff.objects[unit][unitlevel][effect] then + libdebuff:AddEffect(unit, unitlevel, effect) + end end end