f8f03f1 - Fix inspect caching, should now properly cache for 60 sec
authorAleksi Blinnikka <aleksi.blinnikka@gmail.com>
Thu, 12 Apr 2018 20:24:44 +0000
committerAleksi Blinnikka <aleksi.blinnikka@gmail.com>
Thu, 12 Apr 2018 20:24:44 +0000
OmaCD/Cooldowns.lua
OmaCD/Inspect.lua

index c5241f1..6e3ce70 100644 (file)
@@ -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);
index 5c5fb5e..f1d2068 100644 (file)
@@ -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