summaryrefslogtreecommitdiff
path: root/src/game-server/inventory.cpp
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-08-09 11:05:32 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-08-09 11:05:32 +0000
commitf9f87106db18980a7b38dd263820e298d052fa77 (patch)
treee8beb133444c426158c51d112b4af4dff1620be5 /src/game-server/inventory.cpp
parent112137cb64eb66b266ecb11fe50accebb6e38f0b (diff)
downloadmanaserv-f9f87106db18980a7b38dd263820e298d052fa77.tar.gz
manaserv-f9f87106db18980a7b38dd263820e298d052fa77.tar.bz2
manaserv-f9f87106db18980a7b38dd263820e298d052fa77.tar.xz
manaserv-f9f87106db18980a7b38dd263820e298d052fa77.zip
Fixed item move toward a not yet existing slot.
Diffstat (limited to 'src/game-server/inventory.cpp')
-rw-r--r--src/game-server/inventory.cpp10
1 files changed, 9 insertions, 1 deletions
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;
}