diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/game-server/inventory.cpp | 10 |
2 files changed, 14 insertions, 1 deletions
@@ -1,3 +1,8 @@ +2007-08-09 Guillaume Melquiond <guillaume.melquiond@gmail.com> + + * src/game-server/inventory.cpp: Fixed item move toward a not yet + existing slot. + 2007-08-08 Guillaume Melquiond <guillaume.melquiond@gmail.com> * src/net/messageout.hpp, src/net/messageout.cpp: Changed argument diff --git a/src/game-server/inventory.cpp b/src/game-server/inventory.cpp index d3e3321d..8ed39c9f 100644 --- a/src/game-server/inventory.cpp +++ b/src/game-server/inventory.cpp @@ -521,7 +521,15 @@ int Inventory::move(int slot1, int slot2, int amount) return amount; } - assert(false); + // The second slot does not yet exist. + assert(slot2 >= 0); + if (slot2 != 0) + { + InventoryItem it = { 0, slot2 }; + mPoss->inventory.insert(mPoss->inventory.end(), it); + } + InventoryItem it = { id, nb }; + mPoss->inventory.insert(mPoss->inventory.end(), it); return amount; } |