From: Aleksi Blinnikka Date: Thu, 12 Apr 2018 20:24:44 +0000 (+0300) Subject: Fix inspect caching, should now properly cache for 60 sec X-Git-Url: https://www.aleksib.fi/git/wowui.git/commitdiff_plain/f8f03f190e105378eaa96ad227786d8f50f7da76 Fix inspect caching, should now properly cache for 60 sec --- diff --git a/OmaCD/Cooldowns.lua b/OmaCD/Cooldowns.lua index c5241f1..6e3ce70 100644 --- a/OmaCD/Cooldowns.lua +++ b/OmaCD/Cooldowns.lua @@ -197,7 +197,7 @@ end local function updateUnitCD(guid) local specid = guidToSpecid[guid]; - if specid then + if specid and trackedcds[specid] then for spellid, _ in pairs(trackedcds[specid]) do updateCD(guid, specid, spellid); end @@ -233,7 +233,7 @@ local function monkTick() if not InCombatLockdown() then for guid, _ in pairs(monks) do local id = guidToId[guid]; - if id then OmaInspect.Request(guid, id, updateMonk) end + if id then OmaInspect.Request(guid, id, updateMonk, true) end end end CTimerAfter(10, monkTick); diff --git a/OmaCD/Inspect.lua b/OmaCD/Inspect.lua index 5c5fb5e..f1d2068 100644 --- a/OmaCD/Inspect.lua +++ b/OmaCD/Inspect.lua @@ -94,8 +94,8 @@ function OmaInspect.Request(guid, id, callback, needItems, force) cached.cb = callback; cached.needItems = needItems; local elapsed = GetTime() - cached.time; - if force or (not needItems and (not cached.talent or elapsed > 60)) or - (needItems and (not cached.weapon or elapsed > 60)) then + if force or (not needItems and (cached.talent == nil or elapsed > 60)) or + (needItems and (cached.weapon == nil or elapsed > 60)) then if not pending[guid] or inspecting ~= guid then -- don't send multiple inspects inspect(id); end