summaryrefslogtreecommitdiffstats
path: root/src/ItemGrid.cpp
diff options
context:
space:
mode:
authordaniel0916 <theschokolps@gmail.com>2014-04-07 20:12:17 +0200
committerdaniel0916 <theschokolps@gmail.com>2014-04-07 20:12:17 +0200
commit2e9754ac1cf0537c12ab7974cf55c451c0724540 (patch)
tree713c5b8c8f22f77893b30b9c8cefca4a7c491483 /src/ItemGrid.cpp
parentFixed merge conflict (diff)
parentFixed some more minor issues with the redstone simulator. (diff)
downloadcuberite-2e9754ac1cf0537c12ab7974cf55c451c0724540.tar
cuberite-2e9754ac1cf0537c12ab7974cf55c451c0724540.tar.gz
cuberite-2e9754ac1cf0537c12ab7974cf55c451c0724540.tar.bz2
cuberite-2e9754ac1cf0537c12ab7974cf55c451c0724540.tar.lz
cuberite-2e9754ac1cf0537c12ab7974cf55c451c0724540.tar.xz
cuberite-2e9754ac1cf0537c12ab7974cf55c451c0724540.tar.zst
cuberite-2e9754ac1cf0537c12ab7974cf55c451c0724540.zip
Diffstat (limited to 'src/ItemGrid.cpp')
-rw-r--r--src/ItemGrid.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ItemGrid.cpp b/src/ItemGrid.cpp
index e8b58695f..34a267bab 100644
--- a/src/ItemGrid.cpp
+++ b/src/ItemGrid.cpp
@@ -369,6 +369,13 @@ int cItemGrid::ChangeSlotCount(int a_SlotNum, int a_AddToCount)
}
m_Slots[a_SlotNum].m_ItemCount += a_AddToCount;
+
+ cItemHandler * Handler = cItemHandler::GetItemHandler(m_Slots[a_SlotNum].m_ItemType);
+ if (m_Slots[a_SlotNum].m_ItemCount > Handler->GetMaxStackSize())
+ {
+ m_Slots[a_SlotNum].m_ItemCount = Handler->GetMaxStackSize();
+ }
+
TriggerListeners(a_SlotNum);
return m_Slots[a_SlotNum].m_ItemCount;
}