From c1792bbc1b4a3e0404525f8b354e59b8f5938462 Mon Sep 17 00:00:00 2001 From: Luke aka SwissalpS Date: Thu, 15 Jun 2023 03:50:11 +0200 Subject: [PATCH] add warning to ensure double-check was not needed --- autocrafter.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/autocrafter.lua b/autocrafter.lua index 0261494..4eb5187 100644 --- a/autocrafter.lua +++ b/autocrafter.lua @@ -200,8 +200,12 @@ local function autocraft(inventory, craft) -- craft the result into the dst inventory and add any "replacements" as well inventory:add_item("dst", output) + local leftover for i = 1, 9 do - inventory:add_item("dst", craft.decremented_input.items[i]) + leftover = inventory:add_item("dst", craft.decremented_input[i]) + if leftover and not leftover:is_empty() then + minetest.log("warning", "[pipeworks] autocrafter didn't calculate output space correctly.") + end end return true end