[8225] Some fixes from 320 branch.

(backported from commit 4bdcf42)

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
tomrus88 2009-07-21 04:11:45 +04:00 committed by VladimirMangos
parent b7389d2a20
commit a0efd034ca
10 changed files with 85 additions and 59 deletions

View file

@ -3760,9 +3760,9 @@ void Player::BuildCreateUpdateBlockForPlayer( UpdateData *data, Player *target )
Unit::BuildCreateUpdateBlockForPlayer( data, target );
}
void Player::DestroyForPlayer( Player *target ) const
void Player::DestroyForPlayer( Player *target, bool anim ) const
{
Unit::DestroyForPlayer( target );
Unit::DestroyForPlayer( target, anim );
for(int i = 0; i < INVENTORY_SLOT_BAG_END; ++i)
{
@ -10367,7 +10367,6 @@ Item* Player::EquipNewItem( uint16 pos, uint32 item, bool update )
Item* Player::EquipItem( uint16 pos, Item *pItem, bool update )
{
AddEnchantmentDurations(pItem);
AddItemDurations(pItem);
@ -16193,10 +16192,10 @@ void Player::SendAttackSwingBadFacingAttack()
GetSession()->SendPacket( &data );
}
void Player::SendAutoRepeatCancel()
void Player::SendAutoRepeatCancel(Unit *target)
{
WorldPacket data(SMSG_CANCEL_AUTO_REPEAT, GetPackGUID().size());
data.append(GetPackGUID()); // may be it's target guid
WorldPacket data(SMSG_CANCEL_AUTO_REPEAT, target->GetPackGUID().size());
data.append(target->GetPackGUID()); // may be it's target guid
GetSession()->SendPacket( &data );
}
@ -17926,7 +17925,7 @@ void Player::UpdateVisibilityOf(WorldObject* target)
{
if(HaveAtClient(target))
{
if(!target->isVisibleForInState(this,true))
if(!target->isVisibleForInState(this, true))
{
target->DestroyForPlayer(this);
m_clientGUIDs.erase(target->GetGUID());
@ -19538,11 +19537,30 @@ bool Player::HasTitle(uint32 bitIndex)
return HasFlag(PLAYER__FIELD_KNOWN_TITLES + fieldIndexOffset, flag);
}
void Player::SetTitle(CharTitlesEntry const* title)
void Player::SetTitle(CharTitlesEntry const* title, bool lost)
{
uint32 fieldIndexOffset = title->bit_index / 32;
uint32 flag = 1 << (title->bit_index % 32);
SetFlag(PLAYER__FIELD_KNOWN_TITLES + fieldIndexOffset, flag);
if(lost)
{
if(!HasFlag(PLAYER__FIELD_KNOWN_TITLES + fieldIndexOffset, flag))
return;
RemoveFlag(PLAYER__FIELD_KNOWN_TITLES + fieldIndexOffset, flag);
}
else
{
if(HasFlag(PLAYER__FIELD_KNOWN_TITLES + fieldIndexOffset, flag))
return;
SetFlag(PLAYER__FIELD_KNOWN_TITLES + fieldIndexOffset, flag);
}
WorldPacket data(SMSG_TITLE_EARNED, 4 + 4);
data << uint32(title->bit_index);
data << uint32(lost ? 0 : 1); // 1 - earned, 0 - lost
GetSession()->SendPacket(&data);
}
void Player::ConvertRune(uint8 index, uint8 newType)