From 04a469d9111fe506c5ee70ae4bdbeed25fd3aa3d Mon Sep 17 00:00:00 2001 From: Andrew Miner Date: Wed, 8 Apr 2015 11:48:44 -0700 Subject: [PATCH] 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). --- src/coffee/models/crafting_plan.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/coffee/models/crafting_plan.coffee b/src/coffee/models/crafting_plan.coffee index 36b081442..693ead03f 100644 --- a/src/coffee/models/crafting_plan.coffee +++ b/src/coffee/models/crafting_plan.coffee @@ -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)=>