diff options
author | Howaner <franzi.moos@googlemail.com> | 2014-07-18 01:02:25 +0200 |
---|---|---|
committer | Howaner <franzi.moos@googlemail.com> | 2014-07-18 01:02:25 +0200 |
commit | 9c32e31edf7c283d939910f23b9f59edba0d2db6 (patch) | |
tree | d97425a17c5189f0c9868d4443a97d2a0a805b78 | |
parent | Fixed NULL being passed instead of a double to AddEntityEffect (diff) | |
download | cuberite-9c32e31edf7c283d939910f23b9f59edba0d2db6.tar cuberite-9c32e31edf7c283d939910f23b9f59edba0d2db6.tar.gz cuberite-9c32e31edf7c283d939910f23b9f59edba0d2db6.tar.bz2 cuberite-9c32e31edf7c283d939910f23b9f59edba0d2db6.tar.lz cuberite-9c32e31edf7c283d939910f23b9f59edba0d2db6.tar.xz cuberite-9c32e31edf7c283d939910f23b9f59edba0d2db6.tar.zst cuberite-9c32e31edf7c283d939910f23b9f59edba0d2db6.zip |
Diffstat (limited to '')
-rw-r--r-- | src/ItemGrid.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ItemGrid.cpp b/src/ItemGrid.cpp index cd36b1f2a..395547545 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()) { |