summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--src/game-server/inventory.cpp10
2 files changed, 14 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index b8559f00..770b6746 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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;
}