X-Git-Url: https://www.aleksib.fi/git/wowui.git/blobdiff_plain/87236a421791e5e2d2332eef02ff4cbdbc4310be..20b69344f7b68e659f16c9d795bfbf62ee011a85:/OmaCD/Cooldowns.lua diff --git a/OmaCD/Cooldowns.lua b/OmaCD/Cooldowns.lua index 3663615..9c7add4 100644 --- a/OmaCD/Cooldowns.lua +++ b/OmaCD/Cooldowns.lua @@ -282,8 +282,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 +380,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