ba69982 - Fix raid aura throttling and throttle unit frame auras as well
[wowui.git] / OmaRF / Indicators.lua
index 49f3ba1..77b4535 100644 (file)
@@ -2,6 +2,7 @@
 local pairs, ipairs = pairs, ipairs;
 local floor = math.floor;
 local GetTime = GetTime;
 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;
 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;
 
     frame.throttle = function()
         frame.throttled = nil;
-        updateAuras(frame, frame.displayed);
+        if UnitExists(frame.displayed) then
+            return updateAuras(frame, frame.displayed);
+        end
     end;
 end
 
     end;
 end
 
@@ -128,13 +131,13 @@ end
 function M.UpdateAuras(frame, unit)
     local current = GetTime();
     if frame.throttled then
 function M.UpdateAuras(frame, unit)
     local current = GetTime();
     if frame.throttled then
-        print("updateAuras throttled for ", unit); -- TODO debug print
         return;
         return;
-    elseif frame.prevUpdate - current < 0.1 then
+    elseif frame.prevUpdate and current - frame.prevUpdate < 0.2 then
         frame.throttled = true;
         frame.throttled = true;
-        return CTimerAfter(0.1, frame.throttle);
+        return CTimerAfter(0.2, frame.throttle);
     end
 
     end
 
+    frame.prevUpdate = current;
     for _, ind in pairs(frame.inds) do
         hideInd(ind);
     end
     for _, ind in pairs(frame.inds) do
         hideInd(ind);
     end