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:
@@ -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)=>
|
||||
|
||||
Reference in New Issue
Block a user