mirror of
https://github.com/minetest-mods/unified_inventory.git
synced 2025-07-03 17:00:30 +02:00
Continue if item can't be moved to the current position.
This commit is contained in:
@ -349,16 +349,19 @@ function unified_inventory.move_match(inv, src_lists, dst_list, match_table, amo
|
|||||||
local occupied = inv:get_stack(dst_list, pos)
|
local occupied = inv:get_stack(dst_list, pos)
|
||||||
inv:set_stack(dst_list, pos, current)
|
inv:set_stack(dst_list, pos, current)
|
||||||
|
|
||||||
if not occupied:is_empty() then
|
repeat
|
||||||
local leftover = unified_inventory.add_item(inv, src_lists, occupied)
|
if not occupied:is_empty() then
|
||||||
|
local leftover = unified_inventory.add_item(inv, src_lists, occupied)
|
||||||
|
|
||||||
if not leftover:is_empty() then
|
if not leftover:is_empty() then
|
||||||
inv:set_stack(dst_list, pos, leftover)
|
inv:set_stack(dst_list, pos, leftover)
|
||||||
break
|
break
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
removed:take_item(bounded_amount)
|
removed:take_item(bounded_amount)
|
||||||
|
until true
|
||||||
|
|
||||||
moved_positions[pos] = true
|
moved_positions[pos] = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user