Skip to content

Commit

Permalink
Calling CheckInteractDistance() only outside combat
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Nov 17, 2023
1 parent e414066 commit 90746e8
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions core/gears.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1927,7 +1927,8 @@ function ilvl_core:CalcItemLevel (unitid, guid, shout)
unitid = unitid [1]
end

if (unitid and UnitPlayerControlled(unitid) and CheckInteractDistance(unitid, CONST_INSPECT_ACHIEVEMENT_DISTANCE) and CanInspect(unitid)) then
--disable due to changes to CheckInteractDistance()
if (not InCombatLockdown() and unitid and UnitPlayerControlled(unitid) and CheckInteractDistance(unitid, CONST_INSPECT_ACHIEVEMENT_DISTANCE) and CanInspect(unitid)) then

--16 = all itens including main and off hand
local item_amount = 16
Expand Down Expand Up @@ -1982,7 +1983,7 @@ function ilvl_core:CalcItemLevel (unitid, guid, shout)
Details:SendEvent("UNIT_SPEC", nil, unitid, spec, guid)
end

--------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------

for i = 1, 7 do
for o = 1, 3 do
Expand All @@ -2000,7 +2001,8 @@ function ilvl_core:CalcItemLevel (unitid, guid, shout)
Details:SendEvent("UNIT_TALENTS", nil, unitid, talents, guid)
end
end
--------------------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------------------

if (ilvl_core.forced_inspects [guid]) then
if (type(ilvl_core.forced_inspects [guid].callback) == "function") then
Expand All @@ -2012,10 +2014,11 @@ function ilvl_core:CalcItemLevel (unitid, guid, shout)
ilvl_core.forced_inspects [guid] = nil
end

--------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------

end
end

_detalhes.ilevel.CalcItemLevel = ilvl_core.CalcItemLevel

inspect_frame:SetScript("OnEvent", function(self, event, ...)
Expand Down Expand Up @@ -2075,7 +2078,7 @@ function ilvl_core:GetItemLevel (unitid, guid, is_forced, try_number)
return
end

if (not unitid or not CanInspect(unitid) or not UnitPlayerControlled(unitid) or not CheckInteractDistance(unitid, CONST_INSPECT_ACHIEVEMENT_DISTANCE)) then
if (InCombatLockdown() or not unitid or not CanInspect(unitid) or not UnitPlayerControlled(unitid) or not CheckInteractDistance(unitid, CONST_INSPECT_ACHIEVEMENT_DISTANCE)) then
if (is_forced) then
try_number = try_number or 0
if (try_number > 18) then
Expand Down

0 comments on commit 90746e8

Please sign in to comment.