Improve handling of pass-through items in recipes

This commit is contained in:
Andrew Miner
2016-04-16 12:20:29 -07:00
parent 1e96cf2d6c
commit 88e57b1200
5 changed files with 57 additions and 16 deletions
+1 -10
View File
@@ -111,16 +111,7 @@ module.exports = class Recipe extends BaseModel
return result
isPassThroughFor: (itemSlug)->
amountCreated = 0
for stack in @output
if stack.itemSlug.matches itemSlug
amountCreated += stack.quantity
for stack in @input
if stack.itemSlug.matches itemSlug
amountCreated -= stack.quantity
return amountCreated <= 0
return @getQuantityProduced(itemSlug) is @getQuantityRequired(itemSlug)
produces: (itemSlug)->
if not @_produces?