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;
frame.throttle = function()
frame.throttled = nil;
- updateAuras(frame, frame.displayed);
+ if UnitExists(frame.displayed) then
+ return updateAuras(frame, frame.displayed);
+ end
end;
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