summaryrefslogtreecommitdiffstats
path: root/source/cInventory.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-14 10:33:09 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-14 10:33:09 +0200
commite946616772d68f6646710b5c69c237df3ed641c6 (patch)
tree24b09593dfe63a0bf5db9e9ec59ff482c34aba3d /source/cInventory.cpp
parentMade cobwebs transparent (diff)
downloadcuberite-e946616772d68f6646710b5c69c237df3ed641c6.tar
cuberite-e946616772d68f6646710b5c69c237df3ed641c6.tar.gz
cuberite-e946616772d68f6646710b5c69c237df3ed641c6.tar.bz2
cuberite-e946616772d68f6646710b5c69c237df3ed641c6.tar.lz
cuberite-e946616772d68f6646710b5c69c237df3ed641c6.tar.xz
cuberite-e946616772d68f6646710b5c69c237df3ed641c6.tar.zst
cuberite-e946616772d68f6646710b5c69c237df3ed641c6.zip
Diffstat (limited to 'source/cInventory.cpp')
-rw-r--r--source/cInventory.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/cInventory.cpp b/source/cInventory.cpp
index 1f4405470..8750b5368 100644
--- a/source/cInventory.cpp
+++ b/source/cInventory.cpp
@@ -348,7 +348,7 @@ int cInventory::MoveItem(ENUM_ITEM_ID a_ItemType, short a_ItemDamage, int a_Coun
{
int MaxCount = ItemHandler(a_ItemType)->GetMaxStackSize();
ASSERT(m_Slots[i].m_ItemCount <= MaxCount);
- int NumToMove = std::min(a_Count, MaxCount);
+ int NumToMove = std::min(a_Count, MaxCount - m_Slots[i].m_ItemCount);
m_Slots[i].m_ItemCount += NumToMove;
m_Slots[i].m_ItemHealth = a_ItemDamage;
m_Slots[i].m_ItemID = a_ItemType;