changeset 47:eaf233ac41e6 v16

fixed bug with shopping list tab
author yellowfive
date Sun, 02 Nov 2014 11:56:41 -0800
parents d28e38e5240f
children 7056a71acab3
files AskMrRobot.toc ui/ShoppingListTab.lua
diffstat 2 files changed, 10 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/AskMrRobot.toc	Sat Nov 01 22:52:14 2014 -0700
+++ b/AskMrRobot.toc	Sun Nov 02 11:56:41 2014 -0800
@@ -1,7 +1,7 @@
 ## Interface: 60000
 ## Title: Ask Mr. Robot
 ## Author: Team Robot, Inc.
-## Version: 15
+## Version: 16
 ## Notes: Exports/Imports data to/from askmrrobot.com.
 ## URL: www.askmrrobot.com
 ## DefaultState: Enabled
--- a/ui/ShoppingListTab.lua	Sat Nov 01 22:52:14 2014 -0700
+++ b/ui/ShoppingListTab.lua	Sun Nov 02 11:56:41 2014 -0800
@@ -689,10 +689,14 @@
 		self:SetEnchantIcon(row, enchant.optimized)
 		local row2 = row
 		self.enchantIcons[row2].itemName = nil
-		self:GetItemName(enchant.itemId, function(name) 
-			self.enchantIcons[row2].itemName = name 
-			self.enchantIcons[row2].itemText:SetText(name)
-		end)
+		if not enchant.itemId then
+            self.enchantIcons[row2].itemText:SetText("unknown")
+        else
+            self:GetItemName(enchant.itemId, function(name) 
+                self.enchantIcons[row2].itemName = name 
+                self.enchantIcons[row2].itemText:SetText(name)
+            end)
+        end
 		self:SetEnchantQuantity(row, enchant.count, enchant.total)
 		lastControl = self.enchantIcons[row]
 		row = row + 1
@@ -767,15 +771,13 @@
 end
 
 function AskMrRobot.ShoppingListTab:On_GET_ITEM_INFO_RECEIVED()
-	for i = 1, #self.itemNames do
+	for i = #self.itemNames, 1, -1 do
 		local name = GetItemInfo(self.itemNames[i].itemId)
 	    if name then
 	    	self.itemNames[i].func(name)
 	    	tremove(self.itemNames, i)
-	    	i = i - 1
 	    end
 	end
-	self.itemNames = itemNames
 end
 
 function AskMrRobot.ShoppingListTab:OnEvent(frame, event, ...)