diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 13 | ||||
-rw-r--r-- | src/server/game/Entities/Player/Player.h | 2 |
2 files changed, 11 insertions, 4 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index e16acf6dd1d..e8b285d628a 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -7256,7 +7256,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; @@ -7277,7 +7277,8 @@ void Player::_ApplyItemMods(Item* item, uint8 slot, bool apply) _ApplyItemBonuses(item, slot, apply); ApplyItemEquipSpell(item, apply); - ApplyItemDependentAuras(item, apply); + if (updateItemAuras) + ApplyItemDependentAuras(item, apply); ApplyArtifactPowers(item, apply); ApplyEnchantment(item, apply); @@ -12195,7 +12196,7 @@ void Player::RemoveItem(uint8 bag, uint8 slot, bool update) if (pProto && pProto->GetItemSet()) 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) @@ -13200,6 +13201,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); @@ -13212,6 +13216,9 @@ void Player::SwapItem(uint16 src, uint16 dst) EquipChildItem(srcbag, srcslot, pSrcItem); } + if (dstbag == INVENTORY_SLOT_BAG_0 && dstslot < INVENTORY_SLOT_BAG_END) + ApplyItemDependentAuras(pDstItem, false); + // add to src if (IsInventoryPos(src)) StoreItem(sDest2, pDstItem, true); diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index fb79716bed8..9b60c05df1e 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2032,7 +2032,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); |