Quantcast

Modified the checks for reagents before adding to shopping list.

pschifferer [02-28-09 - 15:48]
Modified the checks for reagents before adding to shopping list.
Filename
CauldronMain.lua
diff --git a/CauldronMain.lua b/CauldronMain.lua
index 297c91d..67bcce2 100644
--- a/CauldronMain.lua
+++ b/CauldronMain.lua
@@ -739,7 +739,12 @@ function Cauldron:UpdateShoppingListFromQueue()
 	local items = CauldronQueue:GetReagents(self.db.realm.userdata[self.vars.playername].queue);
 	if items then
 		for i,item in ipairs(items) do
-			Cauldron:AddItemToShoppingList(item.name, item.amount, true);
+			local id = Cauldron:GetIdFromLink(item.link);
+			local have = GetItemCount(item.link);
+			local needed = math.max(0, item.amount - have);
+			if (needed > 0) and Cauldron:IsVendorItem(id) then
+				Cauldron:AddItemToShoppingList(item.name, needed, true);
+			end
 		end
 	end
 end