Skip to content

Commit

Permalink
Fix circular saw item duplication bug (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
afkplayer5000 committed Aug 29, 2021
1 parent e8d219f commit f8a7d66
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions circular_saw.lua
Expand Up @@ -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
Expand Down

0 comments on commit f8a7d66

Please sign in to comment.