return frame;
end
local function updateCD(guid, specid, spellid)
+ if not guidToId[guid] then return end
-- update cd value
local cd = trackedcds[specid][spellid];
if cdfixes[guid] then cd = cd + cdfixes[guid] end
local function updatePriest(guid, specid)
local id = guidToId[guid];
if id then
- if guidToSpecid[guid] ~= specid then
+ if guidToSpecid[guid] ~= specid and frames[guid] then
for _, frame in pairs(frames[guid]) do
removeFrame(frame);
end
idToGuid["player"] = guid;
else
idToGuid["player"] = nil;
- for _, frame in pairs(frames[guid]) do
- removeFrame(frame);
+ if frames[guid] then
+ for _, frame in pairs(frames[guid]) do
+ removeFrame(frame);
+ end
end
end
end
-- just check removals, don't cause inspects
local function fastUpdateUnitids()
- local size = 0;
- local prefix = "solo";
- if IsInGroup() then
- if IsInRaid() then
- size = 40;
- prefix = "raid";
- else
- size = 4;
- prefix = "party";
- end
- end
- for i = 1,size do
- local id = format("%s%i", prefix, i);
- if not UnitExists(id) or UnitGroupRolesAssigned(id) ~= "HEALER" then
- idToGuid[id] = nil;
- if frames[guid] then
- for _, frame in pairs(frames[guid]) do
- removeFrame(frame);
- end
+ for guid, unitFrames in pairs(frames) do
+ if UnitGUID(guidToId[guid]) ~= guid then
+ for _, frame in pairs(unitFrames) do
+ removeFrame(frame);
end
end
end