summaryrefslogtreecommitdiff
path: root/src/inventorymanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/inventorymanager.cpp')
-rw-r--r--src/inventorymanager.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/inventorymanager.cpp b/src/inventorymanager.cpp
index c81f7a19e..1c511e9cb 100644
--- a/src/inventorymanager.cpp
+++ b/src/inventorymanager.cpp
@@ -724,13 +724,19 @@ void ICraftAction::apply(InventoryManager *mgr, ServerActiveObject *player, IGam
}
ItemStack crafted;
+ ItemStack craftresultitem;
int count_remaining = count;
bool found = getCraftingResult(inv_craft, crafted, false, gamedef);
+ PLAYER_TO_SA(player)->item_CraftPredict(crafted, player, list_craft, craft_inv);
+ found = !crafted.empty();
while(found && list_craftresult->itemFits(0, crafted))
{
+ InventoryList saved_craft_list = *list_craft;
+
// Decrement input and add crafting output
getCraftingResult(inv_craft, crafted, true, gamedef);
+ PLAYER_TO_SA(player)->item_OnCraft(crafted, player, &saved_craft_list, craft_inv);
list_craftresult->addItem(0, crafted);
mgr->setInventoryModified(craft_inv);
@@ -747,6 +753,8 @@ void ICraftAction::apply(InventoryManager *mgr, ServerActiveObject *player, IGam
// Get next crafting result
found = getCraftingResult(inv_craft, crafted, false, gamedef);
+ PLAYER_TO_SA(player)->item_CraftPredict(crafted, player, list_craft, craft_inv);
+ found = !crafted.empty();
}
infostream<<"ICraftAction::apply(): crafted "