Continue if item can't be moved to the current position.

This commit is contained in:
Andrey Kozlovskiy 2019-10-17 07:59:06 +03:00
parent 4d67fcab6d
commit 95642bc811
1 changed files with 10 additions and 7 deletions

View File

@ -349,6 +349,7 @@ function unified_inventory.move_match(inv, src_lists, dst_list, match_table, amo
local occupied = inv:get_stack(dst_list, pos)
inv:set_stack(dst_list, pos, current)
repeat
if not occupied:is_empty() then
local leftover = unified_inventory.add_item(inv, src_lists, occupied)
@ -359,6 +360,8 @@ function unified_inventory.move_match(inv, src_lists, dst_list, match_table, amo
end
removed:take_item(bounded_amount)
until true
moved_positions[pos] = true
end