mirror of
https://github.com/minetest-mods/unified_inventory.git
synced 2024-11-10 20:20:25 +01:00
Check for leftover in swap_items.
This commit is contained in:
parent
38203a8c7c
commit
2939d2c645
|
@ -298,7 +298,11 @@ function unified_inventory.swap_items(inv, src_list, dst_lists, exclude)
|
|||
|
||||
if not stack:is_empty() then
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue
Block a user