# HG changeset patch # User Adam tegen # Date 1413522534 18000 # Node ID 4317e56e0a91ec836412162275ea66af0dd3fcad # Parent 0eb7f9a8e9a229de04d2c6a1fa67276c91808a82 Fixed some crash issues with items and gems diff -r 0eb7f9a8e9a2 -r 4317e56e0a91 AskMrRobot.toc --- a/AskMrRobot.toc Wed Oct 15 19:08:21 2014 -0500 +++ b/AskMrRobot.toc Fri Oct 17 00:08:54 2014 -0500 @@ -1,7 +1,7 @@ ## Interface: 60000 ## Title: Ask Mr. Robot ## Author: Team Robot, Inc. -## Version: 6 +## Version: 7 ## Notes: Exports/Imports data to/from askmrrobot.com. ## URL: www.askmrrobot.com ## DefaultState: Enabled diff -r 0eb7f9a8e9a2 -r 4317e56e0a91 amr-constants.lua --- a/amr-constants.lua Wed Oct 15 19:08:21 2014 -0500 +++ b/amr-constants.lua Fri Oct 17 00:08:54 2014 -0500 @@ -23,7 +23,7 @@ --item.difficultyId = tonumber(parts[11]) local numBonuses = tonumber(parts[12]) - if numBonuses > 0 then + if numBonuses and numBonuses > 0 then item.bonusIds = {} for i = 13, 12 + numBonuses do table.insert(item.bonusIds, tonumber(parts[i])) diff -r 0eb7f9a8e9a2 -r 4317e56e0a91 ui/ItemLinkText.lua --- a/ui/ItemLinkText.lua Wed Oct 15 19:08:21 2014 -0500 +++ b/ui/ItemLinkText.lua Fri Oct 17 00:08:54 2014 -0500 @@ -24,7 +24,7 @@ function AskMrRobot.ItemLinkText:SetItemId(itemId, upgradeId, suffixId) AskMrRobot.ItemTooltipFrame.SetItemLink(self, link) self.itemName = nil - if itemId > 0 then + if itemId and itemId > 0 then local linkTemplate = "item:%d:0:0:0:0:0:%d:0:%d:0:%d" local itemName, itemLink = GetItemInfo(linkTemplate:format(itemId, suffixId, UnitLevel("player"), upgradeId)) self:SetItemLink(itemLink) diff -r 0eb7f9a8e9a2 -r 4317e56e0a91 ui/JewelPanel.lua --- a/ui/JewelPanel.lua Wed Oct 15 19:08:21 2014 -0500 +++ b/ui/JewelPanel.lua Fri Oct 17 00:08:54 2014 -0500 @@ -114,7 +114,7 @@ --if i <= #optimizedGems or currentGemLink then if i <= #optimizedGems or currentGemLink then local optimizedGemId = 0 - if optimizedGems[i] > 0 then + if optimizedGems[i] and optimizedGems[i] > 0 then optimizedGemId = AskMrRobot.ExtraGemData[optimizedGems[i]].id end --local currentGemId = AskMrRobot.ExtraGemData[showGems[i]].id @@ -141,7 +141,7 @@ --if showGems[i] and optimizedGems[i] and optimizedGems[i].color then --if test and optimizedGems[i] and optimizedGems[i].color then - if mismatched and optimizedGems[i] > 0 then + if mismatched and optimizedGems[i] and optimizedGems[i] > 0 then gemCount = gemCount + 1 -- set the optimized gem text text:SetTextColor(1,1,1)