Items should first added to the first slot, not the latest.
This commit is contained in:
parent
bc94ad4b5a
commit
9c32e31edf
@ -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 cItemGrid::AddItem(cItem & a_ItemStack, bool a_AllowNewStacks, int a_PrioritarySlot)
|
||||||
{
|
{
|
||||||
int NumLeft = a_ItemStack.m_ItemCount;
|
int NumLeft = a_ItemStack.m_ItemCount;
|
||||||
int MaxStack = ItemHandler(a_ItemStack.m_ItemType)->GetMaxStackSize();
|
int MaxStack = a_ItemStack.GetMaxStackSize();
|
||||||
|
|
||||||
// Try prioritarySlot first:
|
// Try prioritarySlot first:
|
||||||
if (
|
if (
|
||||||
@ -284,7 +284,7 @@ int cItemGrid::AddItem(cItem & a_ItemStack, bool a_AllowNewStacks, int a_Priorit
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Scan existing stacks:
|
// 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))
|
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);
|
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())
|
if (m_Slots[i].IsEmpty())
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user