Core/Player: prevent early aura removal when swapping weapons

Closes #18428
This commit is contained in:
ariel- authored and Aokromes committed 2016-12-16 19:28:06 +01:00
1 parent af85fd52da
commit f32fe0cd0e
2 files changed
+12 -4

No files matched your search

+11 -3
View File
@@ -7672,7 +7672,7 @@ void Player::DuelComplete(DuelCompleteType type)
//---------------------------------------------------------//
void Player::_ApplyItemMods(Item* item, uint8 slot, bool apply)
void Player::_ApplyItemMods(Item* item, uint8 slot, bool apply, bool updateItemAuras /*= true*/)
{
if (slot >= INVENTORY_SLOT_BAG_END || !item)
return;
@@ -7693,7 +7693,9 @@ void Player::_ApplyItemMods(Item* item, uint8 slot, bool apply)
_ApplyItemBonuses(proto, slot, apply);
ApplyItemEquipSpell(item, apply);
ApplyItemDependentAuras(item, apply);
if (updateItemAuras)
ApplyItemDependentAuras(item, apply);
ApplyEnchantment(item, apply);
TC_LOG_DEBUG("entities.player.items", "Player::_ApplyItemMods: completed");
@@ -12012,7 +12014,7 @@ void Player::RemoveItem(uint8 bag, uint8 slot, bool update)
if (pProto && pProto->ItemSet)
RemoveItemsSetItem(this, pProto);
_ApplyItemMods(pItem, slot, false);
_ApplyItemMods(pItem, slot, false, update);
// remove item dependent auras and casts (only weapon and armor slots)
if (slot < EQUIPMENT_SLOT_END)
@@ -12877,6 +12879,9 @@ void Player::SwapItem(uint16 src, uint16 dst)
RemoveItem(dstbag, dstslot, false);
RemoveItem(srcbag, srcslot, false);
if (srcbag == INVENTORY_SLOT_BAG_0 && srcslot < INVENTORY_SLOT_BAG_END)
ApplyItemDependentAuras(pSrcItem, false);
// add to dest
if (IsInventoryPos(dst))
StoreItem(sDest, pSrcItem, true);
@@ -12885,6 +12890,9 @@ void Player::SwapItem(uint16 src, uint16 dst)
else if (IsEquipmentPos(dst))
EquipItem(eDest, pSrcItem, true);
if (dstbag == INVENTORY_SLOT_BAG_0 && dstslot < INVENTORY_SLOT_BAG_END)
ApplyItemDependentAuras(pDstItem, false);
// add to src
if (IsInventoryPos(src))
StoreItem(sDest2, pDstItem, true);
+1 -1
View File
@@ -2174,7 +2174,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
void ApplyItemDependentAuras(Item* item, bool apply);
void _ApplyItemMods(Item* item, uint8 slot, bool apply);
void _ApplyItemMods(Item* item, uint8 slot, bool apply, bool updateItemAuras = true);
void _RemoveAllItemMods();
void _ApplyAllItemMods();
void _ApplyAllLevelScaleItemMods(bool apply);