mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[8501] Apply code style and cleanups to some Player functions.
This commit is contained in:
parent
afe5c9aef8
commit
bd254e2848
2 changed files with 55 additions and 65 deletions
|
|
@ -11413,8 +11413,7 @@ void Player::AddItemToBuyBackSlot( Item *pItem )
|
||||||
uint32 eslot = slot - BUYBACK_SLOT_START;
|
uint32 eslot = slot - BUYBACK_SLOT_START;
|
||||||
|
|
||||||
SetUInt64Value( PLAYER_FIELD_VENDORBUYBACK_SLOT_1 + (eslot * 2), pItem->GetGUID() );
|
SetUInt64Value( PLAYER_FIELD_VENDORBUYBACK_SLOT_1 + (eslot * 2), pItem->GetGUID() );
|
||||||
ItemPrototype const *pProto = pItem->GetProto();
|
if (ItemPrototype const *pProto = pItem->GetProto())
|
||||||
if( pProto )
|
|
||||||
SetUInt32Value( PLAYER_FIELD_BUYBACK_PRICE_1 + eslot, pProto->SellPrice * pItem->GetCount() );
|
SetUInt32Value( PLAYER_FIELD_BUYBACK_PRICE_1 + eslot, pProto->SellPrice * pItem->GetCount() );
|
||||||
else
|
else
|
||||||
SetUInt32Value( PLAYER_FIELD_BUYBACK_PRICE_1 + eslot, 0 );
|
SetUInt32Value( PLAYER_FIELD_BUYBACK_PRICE_1 + eslot, 0 );
|
||||||
|
|
@ -11462,10 +11461,10 @@ void Player::RemoveItemFromBuyBackSlot( uint32 slot, bool del )
|
||||||
void Player::SendEquipError( uint8 msg, Item* pItem, Item *pItem2 )
|
void Player::SendEquipError( uint8 msg, Item* pItem, Item *pItem2 )
|
||||||
{
|
{
|
||||||
sLog.outDebug( "WORLD: Sent SMSG_INVENTORY_CHANGE_FAILURE (%u)", msg);
|
sLog.outDebug( "WORLD: Sent SMSG_INVENTORY_CHANGE_FAILURE (%u)", msg);
|
||||||
WorldPacket data( SMSG_INVENTORY_CHANGE_FAILURE, (msg == EQUIP_ERR_CANT_EQUIP_LEVEL_I ? 22 : 18) );
|
WorldPacket data(SMSG_INVENTORY_CHANGE_FAILURE, (msg == EQUIP_ERR_CANT_EQUIP_LEVEL_I ? 22 : (msg == EQUIP_ERR_OK ? 1 : 18)));
|
||||||
data << uint8(msg);
|
data << uint8(msg);
|
||||||
|
|
||||||
if(msg)
|
if (msg != EQUIP_ERR_OK)
|
||||||
{
|
{
|
||||||
data << uint64(pItem ? pItem->GetGUID() : 0);
|
data << uint64(pItem ? pItem->GetGUID() : 0);
|
||||||
data << uint64(pItem2 ? pItem2->GetGUID() : 0);
|
data << uint64(pItem2 ? pItem2->GetGUID() : 0);
|
||||||
|
|
@ -11634,27 +11633,18 @@ void Player::RemoveAllEnchantments(EnchantmentSlot slot)
|
||||||
// NOTE: no need to remove these from stats, since these aren't equipped
|
// NOTE: no need to remove these from stats, since these aren't equipped
|
||||||
// in inventory
|
// in inventory
|
||||||
for(int i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; ++i)
|
for(int i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; ++i)
|
||||||
{
|
if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i))
|
||||||
Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i );
|
if (pItem->GetEnchantmentId(slot))
|
||||||
if( pItem && pItem->GetEnchantmentId(slot) )
|
|
||||||
pItem->ClearEnchantment(slot);
|
pItem->ClearEnchantment(slot);
|
||||||
}
|
|
||||||
|
|
||||||
// in inventory bags
|
// in inventory bags
|
||||||
for(int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i)
|
for(int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i)
|
||||||
{
|
if (Bag* pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
|
||||||
Bag* pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, i );
|
|
||||||
if( pBag )
|
|
||||||
{
|
|
||||||
for(uint32 j = 0; j < pBag->GetBagSize(); ++j)
|
for(uint32 j = 0; j < pBag->GetBagSize(); ++j)
|
||||||
{
|
if (Item* pItem = pBag->GetItemByPos(j))
|
||||||
Item* pItem = pBag->GetItemByPos(j);
|
if (pItem->GetEnchantmentId(slot))
|
||||||
if( pItem && pItem->GetEnchantmentId(slot) )
|
|
||||||
pItem->ClearEnchantment(slot);
|
pItem->ClearEnchantment(slot);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// duration == 0 will remove item enchant
|
// duration == 0 will remove item enchant
|
||||||
void Player::AddEnchantmentDuration(Item *item,EnchantmentSlot slot,uint32 duration)
|
void Player::AddEnchantmentDuration(Item *item,EnchantmentSlot slot,uint32 duration)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8500"
|
#define REVISION_NR "8501"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue