From e16c3c0f68e0fb78c02718319ea98142a59d8d1c Mon Sep 17 00:00:00 2001 From: Andrew Miner Date: Sun, 18 Aug 2013 19:27:38 -0700 Subject: [PATCH] Fix bug with non-crafted tools being lost * If a "tool" is also a raw material (e.g., as a "cow" is for producing milk), be sure to add it to the inventory so that it shows up as one of the outputs --- html/crafting.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/html/crafting.js b/html/crafting.js index b3be910ff..4a0993b4f 100644 --- a/html/crafting.js +++ b/html/crafting.js @@ -206,6 +206,9 @@ function createRecipe(data) { } } else if (itemRecipe === undefined) { missingMaterials.add(1, name); + if (! consumeItems) { + inventory.add(1, name); + } } else { itemRecipe.craft(inventory, missingMaterials); if (consumeItems) {