diff options
Diffstat (limited to 'src/inventorymanager.cpp')
-rw-r--r-- | src/inventorymanager.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/inventorymanager.cpp b/src/inventorymanager.cpp index bf5a7dd9d..476768b8c 100644 --- a/src/inventorymanager.cpp +++ b/src/inventorymanager.cpp @@ -375,8 +375,9 @@ void IMoveAction::apply(InventoryManager *mgr, ServerActiveObject *player, IGame If something is wrong (source item is empty, destination is the same as source), nothing happens */ + bool did_swap = false; move_count = list_from->moveItem(from_i, - list_to, to_i, count, !caused_by_move_somewhere); + list_to, to_i, count, !caused_by_move_somewhere, &did_swap); // If source is infinite, reset it's stack if (src_can_take_count == -1) { @@ -397,7 +398,7 @@ void IMoveAction::apply(InventoryManager *mgr, ServerActiveObject *player, IGame } } } - if (move_count > 0) { + if (move_count > 0 || did_swap) { list_from->deleteItem(from_i); list_from->addItem(from_i, from_stack_was); } |