mirror of
https://github.com/minetest-mods/moreblocks.git
synced 2025-07-07 10:32:11 +02:00
Apply suggestions from code review
This commit is contained in:
@ -336,7 +336,10 @@ function circular_saw.on_metadata_inventory_take(
|
|||||||
local input_stack = inv:get_stack(listname, index)
|
local input_stack = inv:get_stack(listname, index)
|
||||||
if not input_stack:is_empty() and input_stack:get_name()~=stack:get_name() then
|
if not input_stack:is_empty() and input_stack:get_name()~=stack:get_name() then
|
||||||
local player_inv = player:get_inventory()
|
local player_inv = player:get_inventory()
|
||||||
|
|
||||||
|
-- Prevent arbitrary item duplication.
|
||||||
inv:remove_item(listname, input_stack)
|
inv:remove_item(listname, input_stack)
|
||||||
|
|
||||||
if player_inv:room_for_item("main", input_stack) then
|
if player_inv:room_for_item("main", input_stack) then
|
||||||
player_inv:add_item("main", input_stack)
|
player_inv:add_item("main", input_stack)
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user