forked from minetest-mods/moreblocks
Fix circular saw item duplication bug (#173)
This commit is contained in:
parent
e8d219f108
commit
f8a7d66403
@ -337,6 +337,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)
|
||||||
|
|
||||||
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
|
||||||
|
Loading…
Reference in New Issue
Block a user