[7511] Fixed expertise update at items unequip/drop.

* Not attempt update at item move from slot in bag with equip-like slot number.
* Update at item drop from bag.
This commit is contained in:
VladimirMangos 2009-03-22 02:48:17 +03:00
parent ff48408dbb
commit 2885091dfe
2 changed files with 24 additions and 17 deletions

View file

@ -10707,9 +10707,10 @@ void Player::RemoveItem( uint8 bag, uint8 slot, bool update )
// remove item dependent auras and casts (only weapon and armor slots)
if(slot < EQUIPMENT_SLOT_END)
{
RemoveItemDependentAurasAndCasts(pItem);
// remove held enchantments
// remove held enchantments, update expertise
if ( slot == EQUIPMENT_SLOT_MAINHAND )
{
if (pItem->GetItemSuffixFactor())
@ -10722,6 +10723,11 @@ void Player::RemoveItem( uint8 bag, uint8 slot, bool update )
pItem->ClearEnchantment(PROP_ENCHANTMENT_SLOT_0);
pItem->ClearEnchantment(PROP_ENCHANTMENT_SLOT_1);
}
UpdateExpertise(BASE_ATTACK);
}
else if( slot == EQUIPMENT_SLOT_OFFHAND )
UpdateExpertise(OFF_ATTACK);
}
}
@ -10742,11 +10748,6 @@ void Player::RemoveItem( uint8 bag, uint8 slot, bool update )
pItem->SetSlot( NULL_SLOT );
if( IsInWorld() && update )
pItem->SendUpdateToPlayer( this );
if( slot == EQUIPMENT_SLOT_MAINHAND )
UpdateExpertise(BASE_ATTACK);
else if( slot == EQUIPMENT_SLOT_OFFHAND )
UpdateExpertise(OFF_ATTACK);
}
}
@ -10831,6 +10832,12 @@ void Player::DestroyItem( uint8 bag, uint8 slot, bool update )
// remove item dependent auras and casts (only weapon and armor slots)
RemoveItemDependentAurasAndCasts(pItem);
// update expertise
if ( slot == EQUIPMENT_SLOT_MAINHAND )
UpdateExpertise(BASE_ATTACK);
else if( slot == EQUIPMENT_SLOT_OFFHAND )
UpdateExpertise(OFF_ATTACK);
// equipment visual show
SetVisibleItemSlot(slot,NULL);
}

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "7510"
#define REVISION_NR "7511"
#endif // __REVISION_NR_H__