X-Git-Url: https://www.aleksib.fi/git/wowui.git/blobdiff_plain/87236a421791e5e2d2332eef02ff4cbdbc4310be..43157e64b1540e4b633423a3523f7d031b60de61:/OmaCD/Cooldowns.lua?ds=sidebyside diff --git a/OmaCD/Cooldowns.lua b/OmaCD/Cooldowns.lua index 3663615..c5241f1 100644 --- a/OmaCD/Cooldowns.lua +++ b/OmaCD/Cooldowns.lua @@ -169,6 +169,7 @@ local function getFrame() 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 @@ -253,7 +254,7 @@ 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 @@ -282,8 +283,10 @@ local function updatePlayer() 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 @@ -378,25 +381,10 @@ 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