Check for leftover in swap_items.

This commit is contained in:
Andrey Kozlovskiy 2019-10-16 04:21:11 +03:00
parent 38203a8c7c
commit 2939d2c645

View File

@ -298,7 +298,11 @@ function unified_inventory.swap_items(inv, src_list, dst_lists, exclude)
if not stack:is_empty() then if not stack:is_empty() then
inv:set_stack(src_list, i, empty) inv:set_stack(src_list, i, empty)
unified_inventory.add_item(inv, dst_lists, stack) local leftover = unified_inventory.add_item(inv, dst_lists, stack)
if not leftover:is_empty() then
inv:set_stack(src_list, i, leftover)
end
end end
end end
end end