summaryrefslogtreecommitdiff
path: root/src/game-server
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-08-09 16:09:06 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-08-09 16:09:06 +0000
commitac89d3ab1425f973c6d29cbe9856873489eec69b (patch)
tree0a66eecfe0c7fe6985f83065d43a5ab88607fe8c /src/game-server
parent72ac4235d3abd051f5baed445737b99791951e6c (diff)
downloadmanaserv-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.cpp3
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;