Fixed reported parentheses around comparisons.

This commit is contained in:
Mattes D
2014-12-05 12:58:47 +01:00
parent ad13a80d14
commit 44644ae025
14 changed files with 99 additions and 83 deletions
+6 -2
View File
@@ -507,7 +507,11 @@ bool cInventory::AddToBar( cItem & a_Item, const int a_Offset, const int a_Size,
int MaxStackSize = cItemHandler::GetItemHandler(a_Item.m_ItemType)->GetMaxStackSize();
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)
@@ -533,7 +537,7 @@ bool cInventory::AddToBar( cItem & a_Item, const int a_Offset, const int a_Size,
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)
{