git
/
wowui.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
20b6934
)
77a41d6 - Fix infinite Monk inspects
author
Aleksi Blinnikka <aleksi.blinnikka@gmail.com>
Wed, 21 Mar 2018 22:45:40 +0000
committer
Aleksi Blinnikka <aleksi.blinnikka@gmail.com>
Wed, 21 Mar 2018 22:45:40 +0000
OmaCD/Inspect.lua
patch
|
blob
|
history
diff --git
a/OmaCD/Inspect.lua
b/OmaCD/Inspect.lua
index
498ea06
..
ff0c85f
100644
(file)
--- a/
OmaCD/Inspect.lua
+++ b/
OmaCD/Inspect.lua
@@
-40,7
+40,7
@@
local function inspect(id)
-- not necessary, but there's too many issues with inspect,
-- try to hope being nearby makes it more likely to work
-- no need to inspect people not in range before pull anyway
-- not necessary, but there's too many issues with inspect,
-- try to hope being nearby makes it more likely to work
-- no need to inspect people not in range before pull anyway
- if CheckInteractDistance(id, 1) then
+ if CheckInteractDistance(id, 1)
and CanInspect(id)
then
if not inspecting then
inspecting = guid;
print("Sending inspect", UnitName(id));
if not inspecting then
inspecting = guid;
print("Sending inspect", UnitName(id));
@@
-93,7
+93,7
@@
function OmaInspect.Request(guid, id, callback, needItems, force)
cached.cb = callback;
cached.needItems = needItems;
local elapsed = GetTime() - cached.time;
cached.cb = callback;
cached.needItems = needItems;
local elapsed = GetTime() - cached.time;
- if force or (not needItems and (not cached.talent
~= nil
or elapsed > 60)) or
+ if force or (not needItems and (not cached.talent or elapsed > 60)) or
(needItems and (not cached.weapon or elapsed > 60)) then
if not pending[guid] or inspecting ~= guid then -- don't send multiple inspects
inspect(id);
(needItems and (not cached.weapon or elapsed > 60)) then
if not pending[guid] or inspecting ~= guid then -- don't send multiple inspects
inspect(id);
@@
-105,7
+105,7
@@
function OmaInspect.Request(guid, id, callback, needItems, force)
end
local function inspectReady(guid)
end
local function inspectReady(guid)
- if not guid or inspect
ui then
return end
+ if not guid or inspect
ing ~= guid then print("Got inspect from elsewhere");
return end
local cached = cache[guid];
if cached and cached.id and UnitGUID(cached.id) == guid then
local time = GetTime();
local cached = cache[guid];
if cached and cached.id and UnitGUID(cached.id) == guid then
local time = GetTime();
@@
-114,13
+114,13
@@
local function inspectReady(guid)
redoGuid = nil;
if InCombatLockdown() and not inspectui then
pending[guid] = true;
redoGuid = nil;
if InCombatLockdown() and not inspectui then
pending[guid] = true;
- ClearInspectPlayer();
+ if not inspectui then ClearInspectPlayer() end
else
if CanInspect(id) then
if time - cached.time > 60 then -- refresh >1min
-- new inspect
cached.time = time;
else
if CanInspect(id) then
if time - cached.time > 60 then -- refresh >1min
-- new inspect
cached.time = time;
- if needItems then
+ if
cached.
needItems then
cached.weapon = GetInventoryItemLink(id, INVSLOT_MAINHAND);
cached.wrist = GetInventoryItemID(id, INVSLOT_WRIST);
end
cached.weapon = GetInventoryItemLink(id, INVSLOT_MAINHAND);
cached.wrist = GetInventoryItemID(id, INVSLOT_WRIST);
end
@@
-129,7
+129,7
@@
local function inspectReady(guid)
cached.talent = selected;
end
end
cached.talent = selected;
end
end
- ClearInspectPlayer();
+ if not inspectui then ClearInspectPlayer() end
if (cached.needItems and cached.weapon) or
(not cached.needItems and cached.talent ~= nil) then
print("Got inspect done", UnitName(id));
if (cached.needItems and cached.weapon) or
(not cached.needItems and cached.talent ~= nil) then
print("Got inspect done", UnitName(id));