summaryrefslogtreecommitdiffstats
path: root/source/UI
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-11-12 13:15:09 +0100
committermadmaxoft <github@xoft.cz>2013-11-12 13:15:09 +0100
commit11c5ad1170087dac4c79382f0dd4a18424b5c766 (patch)
tree3025c70fa0a76f5d80f06d7056b2c2a2e9137e18 /source/UI
parentFixed dblclicking in crafting slot area. (diff)
downloadcuberite-11c5ad1170087dac4c79382f0dd4a18424b5c766.tar
cuberite-11c5ad1170087dac4c79382f0dd4a18424b5c766.tar.gz
cuberite-11c5ad1170087dac4c79382f0dd4a18424b5c766.tar.bz2
cuberite-11c5ad1170087dac4c79382f0dd4a18424b5c766.tar.lz
cuberite-11c5ad1170087dac4c79382f0dd4a18424b5c766.tar.xz
cuberite-11c5ad1170087dac4c79382f0dd4a18424b5c766.tar.zst
cuberite-11c5ad1170087dac4c79382f0dd4a18424b5c766.zip
Diffstat (limited to '')
-rw-r--r--source/UI/Window.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/UI/Window.cpp b/source/UI/Window.cpp
index a09f5d682..f5c62692f 100644
--- a/source/UI/Window.cpp
+++ b/source/UI/Window.cpp
@@ -628,7 +628,7 @@ int cWindow::DistributeItemToSlots(cPlayer & a_Player, const cItem & a_Item, int
// Modify the item at the slot
cItem AtSlot(*Area->GetSlot(LocalSlotNum, a_Player));
- int MaxStack = ItemHandler(AtSlot.m_ItemType)->GetMaxStackSize();
+ int MaxStack = AtSlot.GetMaxStackSize();
if (AtSlot.IsEmpty())
{
// Empty, just move all of it there:
@@ -637,7 +637,7 @@ int cWindow::DistributeItemToSlots(cPlayer & a_Player, const cItem & a_Item, int
Area->SetSlot(LocalSlotNum, a_Player, ToStore);
NumDistributed += ToStore.m_ItemCount;
}
- else
+ else if (AtSlot.IsStackableWith(a_Item))
{
// Occupied, add and cap at MaxStack:
int CanStore = std::min(a_NumToEachSlot, (int)MaxStack - AtSlot.m_ItemCount);