comparison ui/JewelPanel.lua @ 28:4317e56e0a91

Fixed some crash issues with items and gems
author Adam tegen <adam.tegen@gmail.com>
date Fri, 17 Oct 2014 00:08:54 -0500
parents e77e01abce98
children
comparison
equal deleted inserted replaced
27:0eb7f9a8e9a2 28:4317e56e0a91
112 112
113 -- if there is a gem to add (or remove) 113 -- if there is a gem to add (or remove)
114 --if i <= #optimizedGems or currentGemLink then 114 --if i <= #optimizedGems or currentGemLink then
115 if i <= #optimizedGems or currentGemLink then 115 if i <= #optimizedGems or currentGemLink then
116 local optimizedGemId = 0 116 local optimizedGemId = 0
117 if optimizedGems[i] > 0 then 117 if optimizedGems[i] and optimizedGems[i] > 0 then
118 optimizedGemId = AskMrRobot.ExtraGemData[optimizedGems[i]].id 118 optimizedGemId = AskMrRobot.ExtraGemData[optimizedGems[i]].id
119 end 119 end
120 --local currentGemId = AskMrRobot.ExtraGemData[showGems[i]].id 120 --local currentGemId = AskMrRobot.ExtraGemData[showGems[i]].id
121 121
122 -- set the current gem icon / tooltip 122 -- set the current gem icon / tooltip
139 139
140 local mismatched = not AskMrRobot.AreGemsCompatible(optimizedGems[i], showGems[i]) 140 local mismatched = not AskMrRobot.AreGemsCompatible(optimizedGems[i], showGems[i])
141 141
142 --if showGems[i] and optimizedGems[i] and optimizedGems[i].color then 142 --if showGems[i] and optimizedGems[i] and optimizedGems[i].color then
143 --if test and optimizedGems[i] and optimizedGems[i].color then 143 --if test and optimizedGems[i] and optimizedGems[i].color then
144 if mismatched and optimizedGems[i] > 0 then 144 if mismatched and optimizedGems[i] and optimizedGems[i] > 0 then
145 gemCount = gemCount + 1 145 gemCount = gemCount + 1
146 -- set the optimized gem text 146 -- set the optimized gem text
147 text:SetTextColor(1,1,1) 147 text:SetTextColor(1,1,1)
148 --text:SetText(AskMrRobot.alternateGemName[optimizedGemId] or (optimizedGems[i] ~= 0 and AskMrRobot.getEnchantName(optimizedGems[i])) or GetItemInfo(optimizedGemId)) 148 --text:SetText(AskMrRobot.alternateGemName[optimizedGemId] or (optimizedGems[i] ~= 0 and AskMrRobot.getEnchantName(optimizedGems[i])) or GetItemInfo(optimizedGemId))
149 149