diff options
author | Mattes D <github@xoft.cz> | 2014-02-15 15:06:23 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-02-15 15:06:23 +0100 |
commit | 48eafee823cb979ded833b5311c0f5c37a8ca0f2 (patch) | |
tree | fad70a53bd337fa152f661e32422da5b9699096e /src/ItemGrid.cpp | |
parent | Merge pull request #677 from mc-server/BroadcastParticleEffect (diff) | |
parent | Fixed typographical error (diff) | |
download | cuberite-48eafee823cb979ded833b5311c0f5c37a8ca0f2.tar cuberite-48eafee823cb979ded833b5311c0f5c37a8ca0f2.tar.gz cuberite-48eafee823cb979ded833b5311c0f5c37a8ca0f2.tar.bz2 cuberite-48eafee823cb979ded833b5311c0f5c37a8ca0f2.tar.lz cuberite-48eafee823cb979ded833b5311c0f5c37a8ca0f2.tar.xz cuberite-48eafee823cb979ded833b5311c0f5c37a8ca0f2.tar.zst cuberite-48eafee823cb979ded833b5311c0f5c37a8ca0f2.zip |
Diffstat (limited to 'src/ItemGrid.cpp')
-rw-r--r-- | src/ItemGrid.cpp | 7 |
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; } |