summaryrefslogtreecommitdiffstats
path: root/src/Inventory.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-07-20 23:10:31 +0200
committermadmaxoft <github@xoft.cz>2014-07-21 17:38:50 +0200
commit6be79575fd50e37ac275bd0cb9d16f9e51e8a225 (patch)
treeb02e68b73bf1152f9d84020ee006d5325e096691 /src/Inventory.cpp
parentCuboid: added explicit copy assignment operator (diff)
downloadcuberite-6be79575fd50e37ac275bd0cb9d16f9e51e8a225.tar
cuberite-6be79575fd50e37ac275bd0cb9d16f9e51e8a225.tar.gz
cuberite-6be79575fd50e37ac275bd0cb9d16f9e51e8a225.tar.bz2
cuberite-6be79575fd50e37ac275bd0cb9d16f9e51e8a225.tar.lz
cuberite-6be79575fd50e37ac275bd0cb9d16f9e51e8a225.tar.xz
cuberite-6be79575fd50e37ac275bd0cb9d16f9e51e8a225.tar.zst
cuberite-6be79575fd50e37ac275bd0cb9d16f9e51e8a225.zip
Diffstat (limited to '')
-rw-r--r--src/Inventory.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Inventory.cpp b/src/Inventory.cpp
index 5f7c24b60..93b2c8eee 100644
--- a/src/Inventory.cpp
+++ b/src/Inventory.cpp
@@ -500,15 +500,15 @@ int cInventory::ArmorSlotNumToEntityEquipmentID(short a_ArmorSlotNum)
bool cInventory::AddToBar( cItem & a_Item, const int a_Offset, const int a_Size, bool* a_bChangedSlots, int a_Mode /* = 0 */ )
{
// Fill already present stacks
- if( a_Mode < 2 )
+ if (a_Mode < 2 )
{
int MaxStackSize = cItemHandler::GetItemHandler(a_Item.m_ItemType)->GetMaxStackSize();
- for(int i = 0; i < a_Size; i++)
+ for (int i = 0; i < a_Size; i++)
{
- if( m_Slots[i + a_Offset].m_ItemType == a_Item.m_ItemType && m_Slots[i + a_Offset].m_ItemCount < MaxStackSize && m_Slots[i + a_Offset].m_ItemDamage == a_Item.m_ItemDamage )
+ if (m_Slots[i + a_Offset].m_ItemType == a_Item.m_ItemType && m_Slots[i + a_Offset].m_ItemCount < MaxStackSize && m_Slots[i + a_Offset].m_ItemDamage == a_Item.m_ItemDamage )
{
int NumFree = MaxStackSize - m_Slots[i + a_Offset].m_ItemCount;
- if( NumFree >= a_Item.m_ItemCount )
+ if (NumFree >= a_Item.m_ItemCount )
{
// printf("1. Adding %i items ( free: %i )\n", a_Item.m_ItemCount, NumFree );
@@ -528,12 +528,12 @@ bool cInventory::AddToBar( cItem & a_Item, const int a_Offset, const int a_Size,
}
}
- if( a_Mode > 0 )
+ if (a_Mode > 0 )
{
// If we got more left, find first empty slot
- for(int i = 0; i < a_Size && a_Item.m_ItemCount > 0; i++)
+ for (int i = 0; i < a_Size && a_Item.m_ItemCount > 0; i++)
{
- if( m_Slots[i + a_Offset].m_ItemType == -1 )
+ if (m_Slots[i + a_Offset].m_ItemType == -1 )
{
m_Slots[i + a_Offset] = a_Item;
a_Item.m_ItemCount = 0;