Core: Continued cleanup
If and for whitespaces.
This commit is contained in:
@@ -299,7 +299,7 @@ Item* TradeData::GetItem(TradeSlots slot) const
|
||||
|
||||
bool TradeData::HasItem(uint64 item_guid) const
|
||||
{
|
||||
for(uint8 i = 0; i < TRADE_SLOT_COUNT; ++i)
|
||||
for (uint8 i = 0; i < TRADE_SLOT_COUNT; ++i)
|
||||
if (m_items[i] == item_guid)
|
||||
return true;
|
||||
|
||||
@@ -7227,7 +7227,7 @@ bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, int32 honor, bool pvpt
|
||||
uint32 itemId = sWorld->getIntConfig(CONFIG_PVP_TOKEN_ID);
|
||||
int32 count = sWorld->getIntConfig(CONFIG_PVP_TOKEN_COUNT);
|
||||
|
||||
if(AddItem(itemId, count))
|
||||
if (AddItem(itemId, count))
|
||||
ChatHandler(this).PSendSysMessage("You have been awarded a token for slaying another player.");
|
||||
}
|
||||
}
|
||||
@@ -7923,7 +7923,7 @@ void Player::_ApplyItemBonuses(ItemTemplate const *proto, uint8 slot, bool apply
|
||||
attType = OFF_ATTACK;
|
||||
}
|
||||
|
||||
if(CanUseAttackType(attType))
|
||||
if (CanUseAttackType(attType))
|
||||
_ApplyWeaponDamage(slot, proto, ssv, apply);
|
||||
|
||||
int32 extraDPS = ssv->getDPSMod(proto->ScalingStatValue);
|
||||
@@ -11185,10 +11185,10 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const
|
||||
{
|
||||
bool b_found = false;
|
||||
|
||||
for (int t = KEYRING_SLOT_START; t < KEYRING_SLOT_END; ++t)
|
||||
for (uint8 t = KEYRING_SLOT_START; t < KEYRING_SLOT_END; ++t)
|
||||
{
|
||||
pItem2 = GetItemByPos( INVENTORY_SLOT_BAG_0, t );
|
||||
if( pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_keys[t-KEYRING_SLOT_START] + pItem->GetCount() <= pProto->GetMaxStackSize())
|
||||
pItem2 = GetItemByPos(INVENTORY_SLOT_BAG_0, t);
|
||||
if (pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_keys[t-KEYRING_SLOT_START] + pItem->GetCount() <= pProto->GetMaxStackSize())
|
||||
{
|
||||
inv_keys[t-KEYRING_SLOT_START] += pItem->GetCount();
|
||||
b_found = true;
|
||||
@@ -11200,7 +11200,7 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const
|
||||
for (int t = CURRENCYTOKEN_SLOT_START; t < CURRENCYTOKEN_SLOT_END; ++t)
|
||||
{
|
||||
pItem2 = GetItemByPos(INVENTORY_SLOT_BAG_0, t);
|
||||
if( pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_tokens[t-CURRENCYTOKEN_SLOT_START] + pItem->GetCount() <= pProto->GetMaxStackSize())
|
||||
if (pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_tokens[t-CURRENCYTOKEN_SLOT_START] + pItem->GetCount() <= pProto->GetMaxStackSize())
|
||||
{
|
||||
inv_tokens[t-CURRENCYTOKEN_SLOT_START] += pItem->GetCount();
|
||||
b_found = true;
|
||||
@@ -11212,7 +11212,7 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const
|
||||
for (int t = INVENTORY_SLOT_ITEM_START; t < INVENTORY_SLOT_ITEM_END; ++t)
|
||||
{
|
||||
pItem2 = GetItemByPos(INVENTORY_SLOT_BAG_0, t);
|
||||
if( pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_slot_items[t-INVENTORY_SLOT_ITEM_START] + pItem->GetCount() <= pProto->GetMaxStackSize())
|
||||
if (pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_slot_items[t-INVENTORY_SLOT_ITEM_START] + pItem->GetCount() <= pProto->GetMaxStackSize())
|
||||
{
|
||||
inv_slot_items[t-INVENTORY_SLOT_ITEM_START] += pItem->GetCount();
|
||||
b_found = true;
|
||||
@@ -11230,7 +11230,7 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const
|
||||
for (uint32 j = 0; j < bag->GetBagSize(); j++)
|
||||
{
|
||||
pItem2 = GetItemByPos(t, j);
|
||||
if( pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_bags[t-INVENTORY_SLOT_BAG_START][j] + pItem->GetCount() <= pProto->GetMaxStackSize())
|
||||
if (pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_bags[t-INVENTORY_SLOT_BAG_START][j] + pItem->GetCount() <= pProto->GetMaxStackSize())
|
||||
{
|
||||
inv_bags[t-INVENTORY_SLOT_BAG_START][j] += pItem->GetCount();
|
||||
b_found = true;
|
||||
@@ -12357,7 +12357,7 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItem bag = %u, slot = %u, item = %u", bag, slot, pItem->GetEntry());
|
||||
// Also remove all contained items if the item is a bag.
|
||||
// This if() prevents item saving crashes if the condition for a bag to be empty before being destroyed was bypassed somehow.
|
||||
// This if () prevents item saving crashes if the condition for a bag to be empty before being destroyed was bypassed somehow.
|
||||
if (pItem->IsNotEmptyBag())
|
||||
for (uint8 i = 0; i < MAX_BAG_SIZE; ++i)
|
||||
DestroyItem(slot, i, update);
|
||||
@@ -13517,7 +13517,7 @@ void Player::ApplyEnchantment(Item *item, EnchantmentSlot slot, bool apply, bool
|
||||
|
||||
// If we're dealing with a gem inside a prismatic socket we need to check the prismatic socket requirements
|
||||
// rather than the gem requirements itself. If the socket has no color it is a prismatic socket.
|
||||
if((slot == SOCK_ENCHANTMENT_SLOT || slot == SOCK_ENCHANTMENT_SLOT_2 || slot == SOCK_ENCHANTMENT_SLOT_3)
|
||||
if ((slot == SOCK_ENCHANTMENT_SLOT || slot == SOCK_ENCHANTMENT_SLOT_2 || slot == SOCK_ENCHANTMENT_SLOT_3)
|
||||
&& !item->GetTemplate()->Socket[slot-SOCK_ENCHANTMENT_SLOT].Color)
|
||||
{
|
||||
// Check if the requirements for the prismatic socket are met before applying the gem stats
|
||||
@@ -24463,7 +24463,7 @@ bool Player::AddItem(uint32 itemId, uint32 count)
|
||||
}
|
||||
|
||||
Item* item = StoreNewItem(dest, itemId, true, Item::GenerateItemRandomPropertyId(itemId));
|
||||
if(item)
|
||||
if (item)
|
||||
SendNewItem(item, count, true, false);
|
||||
else
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user