Quantcast

Made the potential craft count only consider "key" reagents.

pschifferer [02-24-09 - 06:44]
Made the potential craft count only consider "key" reagents.
Filename
CauldronUtil.lua
diff --git a/CauldronUtil.lua b/CauldronUtil.lua
index 1c8a4ab..8713476 100644
--- a/CauldronUtil.lua
+++ b/CauldronUtil.lua
@@ -19,11 +19,14 @@ function Cauldron:GetPotentialCraftCount(skillInfo)
 	-- than one reagent
 	if #skillInfo.reagents > 1 then
 		for i,rinfo in ipairs(skillInfo.reagents) do
-			local counts = Cauldron:ReagentCount(rinfo.name);
-			local makeable = math.floor(counts.total / rinfo.numRequired);
-
-			if (makeable > 0) and (count > 0) and (makeable < count) then
-				count = makeable;
+			-- only count "key" reagents
+			if rinfo.key then
+				local counts = Cauldron:ReagentCount(rinfo.name);
+				local makeable = math.floor(counts.total / rinfo.numRequired);
+
+				if (makeable > 0) and (count > 0) and (makeable < count) then
+					count = makeable;
+				end
 			end
 		end
 	end