X-Git-Url: https://www.aleksib.fi/git/wowui.git/blobdiff_plain/330739114047596de17fabf5182c25b065ebde39..1b9f0730c644c1df586bbe9dc59458d640cf15fa:/OmaRF/Indicators.lua?ds=sidebyside diff --git a/OmaRF/Indicators.lua b/OmaRF/Indicators.lua index 49f3ba1..77b4535 100644 --- a/OmaRF/Indicators.lua +++ b/OmaRF/Indicators.lua @@ -2,6 +2,7 @@ local pairs, ipairs = pairs, ipairs; local floor = math.floor; local GetTime = GetTime; +local UnitExists = UnitExists; local UnitAura = UnitAura; local CreateFrame = CreateFrame; local UnitIsDeadOrGhost, UnitIsConnected = UnitIsDeadOrGhost, UnitIsConnected; @@ -54,7 +55,9 @@ function M.SetupIndicators(frame, class) frame.throttle = function() frame.throttled = nil; - updateAuras(frame, frame.displayed); + if UnitExists(frame.displayed) then + return updateAuras(frame, frame.displayed); + end end; end @@ -128,13 +131,13 @@ end function M.UpdateAuras(frame, unit) local current = GetTime(); if frame.throttled then - print("updateAuras throttled for ", unit); -- TODO debug print return; - elseif frame.prevUpdate - current < 0.1 then + elseif frame.prevUpdate and current - frame.prevUpdate < 0.2 then frame.throttled = true; - return CTimerAfter(0.1, frame.throttle); + return CTimerAfter(0.2, frame.throttle); end + frame.prevUpdate = current; for _, ind in pairs(frame.inds) do hideInd(ind); end