fix(Core/Spells): Properly remove item dependent passive auras on item unequip (#7944)
This commit is contained in:
parent
f130099170
commit
ab59991106
1 changed files with 32 additions and 24 deletions
|
|
@ -2905,33 +2905,41 @@ void Player::RemoveItem(uint8 bag, uint8 slot, bool update, bool swap)
|
|||
RemoveItemsSetItem(this, pProto);
|
||||
|
||||
_ApplyItemMods(pItem, slot, false);
|
||||
|
||||
// remove item dependent auras and casts (only weapon and armor slots)
|
||||
if (slot < EQUIPMENT_SLOT_END)
|
||||
{
|
||||
// Xinef: Ensure that this function is called for places with swap=true
|
||||
if (!swap)
|
||||
RemoveItemDependentAurasAndCasts(pItem);
|
||||
|
||||
// remove held enchantments, update expertise
|
||||
if (slot == EQUIPMENT_SLOT_MAINHAND)
|
||||
UpdateExpertise(BASE_ATTACK);
|
||||
else if (slot == EQUIPMENT_SLOT_OFFHAND)
|
||||
UpdateExpertise(OFF_ATTACK);
|
||||
// update armor penetration - passive auras may need it
|
||||
switch (slot)
|
||||
{
|
||||
case EQUIPMENT_SLOT_MAINHAND:
|
||||
case EQUIPMENT_SLOT_OFFHAND:
|
||||
case EQUIPMENT_SLOT_RANGED:
|
||||
RecalculateRating(CR_ARMOR_PENETRATION);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_items[slot] = nullptr;
|
||||
|
||||
// remove item dependent auras and casts (only weapon and armor slots)
|
||||
if (slot < INVENTORY_SLOT_BAG_END && slot < EQUIPMENT_SLOT_END)
|
||||
{
|
||||
// Xinef: Ensure that this function is called for places with swap=true
|
||||
if (!swap)
|
||||
{
|
||||
RemoveItemDependentAurasAndCasts(pItem);
|
||||
}
|
||||
|
||||
// remove held enchantments, update expertise
|
||||
if (slot == EQUIPMENT_SLOT_MAINHAND)
|
||||
{
|
||||
UpdateExpertise(BASE_ATTACK);
|
||||
}
|
||||
else if (slot == EQUIPMENT_SLOT_OFFHAND)
|
||||
{
|
||||
UpdateExpertise(OFF_ATTACK);
|
||||
}
|
||||
|
||||
// update armor penetration - passive auras may need it
|
||||
switch (slot)
|
||||
{
|
||||
case EQUIPMENT_SLOT_MAINHAND:
|
||||
case EQUIPMENT_SLOT_OFFHAND:
|
||||
case EQUIPMENT_SLOT_RANGED:
|
||||
RecalculateRating(CR_ARMOR_PENETRATION);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
SetGuidValue(PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2), ObjectGuid::Empty);
|
||||
|
||||
if (slot < EQUIPMENT_SLOT_END)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue