diff options
author | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-08-09 15:55:27 +0000 |
---|---|---|
committer | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-08-09 15:55:27 +0000 |
commit | 72ac4235d3abd051f5baed445737b99791951e6c (patch) | |
tree | ad01ecaf6843b405a8d97f5812e3973077eddd57 /src/game-server/inventory.cpp | |
parent | 4a0a3305191b3be51542bed5c382edae3aba7058 (diff) | |
download | manaserv-72ac4235d3abd051f5baed445737b99791951e6c.tar.gz manaserv-72ac4235d3abd051f5baed445737b99791951e6c.tar.xz manaserv-72ac4235d3abd051f5baed445737b99791951e6c.zip |
Fixed strange behavior of inventory.
Diffstat (limited to 'src/game-server/inventory.cpp')
-rw-r--r-- | src/game-server/inventory.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/game-server/inventory.cpp b/src/game-server/inventory.cpp index 8ed39c9..07e6d49 100644 --- a/src/game-server/inventory.cpp +++ b/src/game-server/inventory.cpp @@ -382,7 +382,7 @@ int Inventory::remove(int itemId, int amount) int Inventory::move(int slot1, int slot2, int amount) { - if (amount == 0 || slot2 >= INVENTORY_SLOTS) + if (amount == 0 || slot1 == slot2 || slot2 >= INVENTORY_SLOTS) { return amount; } @@ -503,14 +503,14 @@ int Inventory::move(int slot1, int slot2, int amount) if (slot2 == 0) { // First slot in an empty range. - mPoss->inventory.insert(i + 1, it); + mPoss->inventory.insert(i, it); return amount; } if (slot2 == i->amount) { // Last slot in an empty range. - mPoss->inventory.insert(i, it); + mPoss->inventory.insert(i + 1, it); return amount; } |