From f8a7d66403b4b1e2d87eeb4249a9be3edb906861 Mon Sep 17 00:00:00 2001 From: afkplayer5000 <77247273+afkplayer5000@users.noreply.github.com> Date: Sun, 29 Aug 2021 00:23:47 -0600 Subject: [PATCH] Fix circular saw item duplication bug (#173) --- circular_saw.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/circular_saw.lua b/circular_saw.lua index 15c933e..933e2dd 100644 --- a/circular_saw.lua +++ b/circular_saw.lua @@ -337,6 +337,10 @@ function circular_saw.on_metadata_inventory_take( local input_stack = inv:get_stack(listname, index) if not input_stack:is_empty() and input_stack:get_name()~=stack:get_name() then local player_inv = player:get_inventory() + + -- Prevent arbitrary item duplication. + inv:remove_item(listname, input_stack) + if player_inv:room_for_item("main", input_stack) then player_inv:add_item("main", input_stack) end