mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 03:15:41 +00:00
fix(Core/Spells): Properly remove item dependent passive auras on item unequip (#7944)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user