fix querying self

This commit is contained in:
andrew6180
2024-05-26 20:46:11 -07:00
parent aac7ef6e35
commit df7799d8f9
+9 -2
View File
@@ -1938,7 +1938,6 @@ function ilvl_core:CalcItemLevel (unitid, guid, shout)
--disable due to changes to CheckInteractDistance() --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 if (not InCombatLockdown() and unitid and UnitPlayerControlled(unitid) and CheckInteractDistance(unitid, CONST_INSPECT_ACHIEVEMENT_DISTANCE) and CanInspect(unitid)) then
local average = UnitAverageItemLevel(unitid) local average = UnitAverageItemLevel(unitid)
--register --register
if (average > 0) then if (average > 0) then
if (shout) then if (shout) then
@@ -2029,6 +2028,11 @@ function ilvl_core:GetItemLevel (unitid, guid, is_forced, try_number)
return return
end 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 (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 if (is_forced) then
try_number = try_number or 0 try_number = try_number or 0
@@ -2055,7 +2059,7 @@ local NotifyInspectHook = function(unitid) --not in use
local guid = UnitGUID(unitid) local guid = UnitGUID(unitid)
local name = Details:GetFullName(unitid) local name = Details:GetFullName(unitid)
if (guid and name and not inspecting [guid]) then 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 if (name == Details:GetFullName(unit .. i)) then
unitid = unit .. i unitid = unit .. i
break break
@@ -2096,6 +2100,9 @@ function ilvl_core:QueryInspect (unitName, callback, param1)
break break
end end
end end
if not unitid then -- player
unitid = unitName
end
else else
unitid = unitName unitid = unitName
end end