diff Modules/AuctionHouse.lua @ 94:4ec8611d9466

Fixed Enchanting. I was not getting the ItemID correctly, so enchants could not be mapped to the scrolls they were to created Changed snatch to only add each item once and to only add a snatch for items you don't have API: Added haveMaterials to the item and need to the reagents that get passed to queue destinations. This is in preparation for building a shopping list module.
author Asa Ayers <Asa.Ayers@Gmail.com>
date Wed, 11 Aug 2010 23:48:23 -0700
parents 693f664aad2b
children 4f26dc55455d
line wrap: on
line diff
--- a/Modules/AuctionHouse.lua	Wed Aug 11 22:16:59 2010 -0700
+++ b/Modules/AuctionHouse.lua	Wed Aug 11 23:48:23 2010 -0700
@@ -105,10 +105,16 @@
 	end
 	clearSnatch()
 
+	local snatchList = {}
 	local function Export(data)
-		for id, reagent in pairs(data.reagents) do
-			ItemAuditor:Print("Adding %s for %s", reagent.link, Utils.FormatMoney(reagent.price))
-			Snatch.AddSnatch(reagent.link, reagent.price)
+		if not data.haveMaterials then
+			for id, reagent in pairs(data.reagents) do
+				if reagent.need > 0 and not snatchList[reagent.link] then
+					snatchList[reagent.link] = true
+					ItemAuditor:Print("Adding %s for %s", reagent.link, Utils.FormatMoney(reagent.price))
+					Snatch.AddSnatch(reagent.link, reagent.price)
+				end
+			end
 		end
 	end
 	ItemAuditor:UpdateCraftingTable()