summaryrefslogtreecommitdiffstats
path: root/src/ItemGrid.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-07-26 16:46:07 +0200
committerMattes D <github@xoft.cz>2014-07-26 16:46:07 +0200
commit3a6b3a16b8f4bdcc9468940428cf11f60e29c9ba (patch)
tree832b5e4ac6fb940a5effa310e858d7454dcf4f41 /src/ItemGrid.cpp
parentGit: Ignore AllFiles.lst (generated by cmake) (diff)
parentChange comment. (diff)
downloadcuberite-3a6b3a16b8f4bdcc9468940428cf11f60e29c9ba.tar
cuberite-3a6b3a16b8f4bdcc9468940428cf11f60e29c9ba.tar.gz
cuberite-3a6b3a16b8f4bdcc9468940428cf11f60e29c9ba.tar.bz2
cuberite-3a6b3a16b8f4bdcc9468940428cf11f60e29c9ba.tar.lz
cuberite-3a6b3a16b8f4bdcc9468940428cf11f60e29c9ba.tar.xz
cuberite-3a6b3a16b8f4bdcc9468940428cf11f60e29c9ba.tar.zst
cuberite-3a6b3a16b8f4bdcc9468940428cf11f60e29c9ba.zip
Diffstat (limited to '')
-rw-r--r--src/ItemGrid.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ItemGrid.cpp b/src/ItemGrid.cpp
index 38829cbf8..2344dc0a5 100644
--- a/src/ItemGrid.cpp
+++ b/src/ItemGrid.cpp
@@ -269,7 +269,7 @@ int cItemGrid::AddItemToSlot(const cItem & a_ItemStack, int a_Slot, int a_Num, i
int cItemGrid::AddItem(cItem & a_ItemStack, bool a_AllowNewStacks, int a_PrioritarySlot)
{
int NumLeft = a_ItemStack.m_ItemCount;
- int MaxStack = ItemHandler(a_ItemStack.m_ItemType)->GetMaxStackSize();
+ int MaxStack = a_ItemStack.GetMaxStackSize();
// Try prioritarySlot first:
if (
@@ -284,7 +284,7 @@ int cItemGrid::AddItem(cItem & a_ItemStack, bool a_AllowNewStacks, int a_Priorit
}
// Scan existing stacks:
- for (int i = m_NumSlots - 1; i >= 0; i--)
+ for (int i = 0; i < m_NumSlots; i++)
{
if (m_Slots[i].IsEqual(a_ItemStack))
{
@@ -302,7 +302,7 @@ int cItemGrid::AddItem(cItem & a_ItemStack, bool a_AllowNewStacks, int a_Priorit
return (a_ItemStack.m_ItemCount - NumLeft);
}
- for (int i = m_NumSlots - 1; i >= 0; i--)
+ for (int i = 0; i < m_NumSlots; i++)
{
if (m_Slots[i].IsEmpty())
{