From 51cd36088588a0ee826ef74cd26a3078646c6c41 Mon Sep 17 00:00:00 2001 From: pschifferer Date: Tue, 24 Feb 2009 06:40:34 +0000 Subject: [PATCH] Fixes to potential craft calculation. --- CauldronUtil.lua | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/CauldronUtil.lua b/CauldronUtil.lua index 4b57b68..1c8a4ab 100644 --- a/CauldronUtil.lua +++ b/CauldronUtil.lua @@ -15,13 +15,16 @@ function Cauldron:GetPotentialCraftCount(skillInfo) local count = 999999; -- iterate over the reagent list and find out how many can be made for each reagent count; - -- the lowest value is the potential amount craftable - 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; + -- the lowest value is the potential amount craftable; only count a skill if it has more + -- 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; + end end end -- 1.7.9.5