Fix bug in crafting plan with secondary outputs

Fix a bug in the crafting plan where it would determine the number of
repetitions of the recipe only based upon the primary output even
when the recipe was needed only for a secondary output (e.g., when a
recipe calls for Creosote Oil, which is only produced as a secondary
output).
This commit is contained in:
Andrew Miner
2015-04-08 11:48:44 -07:00
parent 78cc1bf297
commit 04a469d911
+2 -1
View File
@@ -173,8 +173,9 @@ module.exports = class CraftingPlan extends BaseModel
for i in [@steps.length-1..0] by -1
step = @steps[i]
recipe = step.recipe
outputQuantity = recipe.getQuantityProducedOf step.itemSlug
step.multiplier = Math.ceil(@need.quantityOf(step.itemSlug) / recipe.output[0].quantity)
step.multiplier = Math.ceil(@need.quantityOf(step.itemSlug) / outputQuantity)
if @includingTools
recipe.eachToolStack (stack)=>