From df7799d8f9d7878cbf88ec2d58b9a111a689a775 Mon Sep 17 00:00:00 2001 From: andrew6180 <16847730+andrew6180@users.noreply.github.com> Date: Sun, 26 May 2024 20:46:11 -0700 Subject: [PATCH] fix querying self --- core/gears.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/core/gears.lua b/core/gears.lua index 2687b96b..200a9fd8 100644 --- a/core/gears.lua +++ b/core/gears.lua @@ -1938,7 +1938,6 @@ function ilvl_core:CalcItemLevel (unitid, guid, shout) --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 local average = UnitAverageItemLevel(unitid) - --register if (average > 0) then if (shout) then @@ -2029,6 +2028,11 @@ function ilvl_core:GetItemLevel (unitid, guid, is_forced, try_number) return end + if UnitIsUnit(unitid, "player") then + ilvl_core:CalcItemLevel(unitid, guid) + return + end + if (AscensionInspectFrame and AscensionInspectFrame:IsShown() or 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 @@ -2055,7 +2059,7 @@ local NotifyInspectHook = function(unitid) --not in use local guid = UnitGUID(unitid) local name = Details:GetFullName(unitid) if (guid and name and not inspecting [guid]) then - for i = 1, GetNumGroupMembers() do + for i = 1, GetNumGroupMembers()-1 do if (name == Details:GetFullName(unit .. i)) then unitid = unit .. i break @@ -2096,6 +2100,9 @@ function ilvl_core:QueryInspect (unitName, callback, param1) break end end + if not unitid then -- player + unitid = unitName + end else unitid = unitName end