diff options
author | megamage <none@none> | 2009-03-21 22:42:40 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-03-21 22:42:40 -0600 |
commit | 0c9aeaa9656c95043f077a84262f52adfc7b53ac (patch) | |
tree | 253348ac3df386ee0e641717bc6c9c285f5782ef /src/game/Player.cpp | |
parent | ddb7265018d15660ac1a8f97b1c5162e0e161647 (diff) |
[7511] Fixed expertise update at items unequip/drop. Author: VladimirMangos
* Not attempt update at item move from slot in bag with equip-like slot number.
* Update at item drop from bag.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Player.cpp')
-rw-r--r-- | src/game/Player.cpp | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 35317d9ded8..691a56557bc 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -11003,21 +11003,27 @@ 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 - if ( slot == EQUIPMENT_SLOT_MAINHAND ) - { - if (pItem->GetItemSuffixFactor()) - { - pItem->ClearEnchantment(PROP_ENCHANTMENT_SLOT_3); - pItem->ClearEnchantment(PROP_ENCHANTMENT_SLOT_4); - } - else + // remove held enchantments, update expertise + if ( slot == EQUIPMENT_SLOT_MAINHAND ) { - pItem->ClearEnchantment(PROP_ENCHANTMENT_SLOT_0); - pItem->ClearEnchantment(PROP_ENCHANTMENT_SLOT_1); + if (pItem->GetItemSuffixFactor()) + { + pItem->ClearEnchantment(PROP_ENCHANTMENT_SLOT_3); + pItem->ClearEnchantment(PROP_ENCHANTMENT_SLOT_4); + } + else + { + pItem->ClearEnchantment(PROP_ENCHANTMENT_SLOT_0); + pItem->ClearEnchantment(PROP_ENCHANTMENT_SLOT_1); + } + + UpdateExpertise(BASE_ATTACK); } + else if( slot == EQUIPMENT_SLOT_OFFHAND ) + UpdateExpertise(OFF_ATTACK); } } @@ -11038,11 +11044,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); } } @@ -11127,6 +11128,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); } |