diff --git a/src/inventory.cpp b/src/inventory.cpp index 6c7c8cdd1..af8b1b301 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -163,7 +163,7 @@ void ItemStack::deSerialize(std::istream &is, IItemDefManager *itemdef) std::getline(is, tmp, ' '); if(!tmp.empty()) throw SerializationError("Unexpected text after item name"); - + if(name == "MaterialItem") { // Obsoleted on 2011-07-30 @@ -478,7 +478,7 @@ void InventoryList::setName(const std::string &name) void InventoryList::serialize(std::ostream &os) const { //os.imbue(std::locale("C")); - + os<<"Width "<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); }