diff options
author | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-08-09 16:09:06 +0000 |
---|---|---|
committer | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-08-09 16:09:06 +0000 |
commit | ac89d3ab1425f973c6d29cbe9856873489eec69b (patch) | |
tree | 0a66eecfe0c7fe6985f83065d43a5ab88607fe8c /src/game-server | |
parent | 72ac4235d3abd051f5baed445737b99791951e6c (diff) | |
download | manaserv-ac89d3ab1425f973c6d29cbe9856873489eec69b.tar.gz manaserv-ac89d3ab1425f973c6d29cbe9856873489eec69b.tar.bz2 manaserv-ac89d3ab1425f973c6d29cbe9856873489eec69b.tar.xz manaserv-ac89d3ab1425f973c6d29cbe9856873489eec69b.zip |
Prevented player from merging too many items.
Diffstat (limited to 'src/game-server')
-rw-r--r-- | src/game-server/inventory.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/game-server/inventory.cpp b/src/game-server/inventory.cpp index 07e6d49b..af780117 100644 --- a/src/game-server/inventory.cpp +++ b/src/game-server/inventory.cpp @@ -404,7 +404,8 @@ int Inventory::move(int slot1, int slot2, int amount) if (it1.itemId == it2.itemId) { // Move between two stacks of the same kind. - int nb = std::min(std::min(amount, (int)it1.amount), 255 - it2.amount); + int maxPerSlot = ItemManager::getItem(it1.itemId)->getMaxPerSlot(); + int nb = std::min(std::min(amount, (int)it1.amount), maxPerSlot - it2.amount); if (nb == 0) { return amount; |