From dc4b64a46a4fc88f41f5e6ac2ca3d9fa9507473a Mon Sep 17 00:00:00 2001 From: kibsgaard Date: Thu, 20 Nov 2014 13:52:53 +0100 Subject: [PATCH] Signed-off-by: kibsgaard --- KibsItemLevel.lua | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/KibsItemLevel.lua b/KibsItemLevel.lua index b373fc6..cc13976 100644 --- a/KibsItemLevel.lua +++ b/KibsItemLevel.lua @@ -371,9 +371,9 @@ function findItemInfo(who) ilvl = findHeirloomilvl(); end - _,_,_, color = GetItemQualityColor(quality); - - + if(quality) then + _,_,_, color = GetItemQualityColor(quality); + end if (upgrade and KibsItemLevelConfig.upgrades) then ActiveFontStrings[i]:SetText(ilvl .." ("..upgrade.."/"..max..")") @@ -456,11 +456,16 @@ function findHeirloomilvl() local line = ""; for i = 2, GameTooltip:NumLines() do line = _G[GameTooltip:GetName().."TextLeft"..i]; + if (line) then line = line:GetText(); + if (line) then - if(line:match("Item Level")) then - return tonumber(line:match("%d+")); + if(line:match("%d+")) then + local number = tonumber(line:match("%d+")); + if(number > 0) then + return number; + end end end end -- 1.7.9.5