diff --git a/MyAddon.lua b/MyAddon.lua index a7ac4cb..eef31fc 100755 --- a/MyAddon.lua +++ b/MyAddon.lua @@ -55,9 +55,6 @@ function GetUnitFromGuid(guid) end function events:INSPECT_READY(guid) - local itemLevel = C_PaperDollInfo.GetInspectItemLevel(GetUnitFromGuid(guid)) - print(itemLevel) - if not inspectInitialized then print("initializing") InspectFontStrings["itemLevel"] = InspectFrame:CreateFontString(nil, "OVERLAY") @@ -68,8 +65,12 @@ function events:INSPECT_READY(guid) inspectInitialized = true end - InspectFontStrings["itemLevel"]:SetText(itemLevel) - print(InspectFontStrings["itemLevel"]:GetText()) + + unit = GetUnitFromGuid(guid) + if unit then + local itemLevel = C_PaperDollInfo.GetInspectItemLevel(unit) + InspectFontStrings["itemLevel"]:SetText(itemLevel) + end end function events:GOSSIP_SHOW()