Apply suggestions from code review

This commit is contained in:
Hugo Locurcio
2021-01-16 22:07:52 +01:00
committed by GitHub
parent e26e3cc183
commit 5c7d5b2cc3

View File

@ -336,7 +336,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