aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Player/Player.cpp11
-rw-r--r--src/server/game/Handlers/ItemHandler.cpp5
2 files changed, 10 insertions, 6 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 6ff813ca9df..8e7edcc0dd9 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -13063,9 +13063,6 @@ 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);
@@ -13074,9 +13071,6 @@ 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);
@@ -13085,6 +13079,11 @@ void Player::SwapItem(uint16 src, uint16 dst)
else if (IsEquipmentPos(src))
EquipItem(eDest2, pDstItem, true);
+ // if inventory item was moved, check if we can remove dependent auras, because they were not removed in Player::RemoveItem (update was set to false)
+ // do this after swaps are done, we pass nullptr because both weapons could be swapped and none of them should be ignored
+ if ((srcbag == INVENTORY_SLOT_BAG_0 && srcslot < INVENTORY_SLOT_BAG_END) || (dstbag == INVENTORY_SLOT_BAG_0 && dstslot < INVENTORY_SLOT_BAG_END))
+ ApplyItemDependentAuras((Item*)nullptr, false);
+
// if player is moving bags and is looting an item inside this bag
// release the loot
if (GetLootGUID())
diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp
index 8f9a3ba6ffc..285edf4f143 100644
--- a/src/server/game/Handlers/ItemHandler.cpp
+++ b/src/server/game/Handlers/ItemHandler.cpp
@@ -253,6 +253,11 @@ void WorldSession::HandleAutoEquipItemOpcode(WorldPacket& recvData)
_player->EquipItem(eSrc, pDstItem, true);
_player->AutoUnequipOffhandIfNeed();
+
+ // if inventory item was moved, check if we can remove dependent auras, because they were not removed in Player::RemoveItem (update was set to false)
+ // do this after swaps are done, we pass nullptr because both weapons could be swapped and none of them should be ignored
+ if ((srcbag == INVENTORY_SLOT_BAG_0 && srcslot < INVENTORY_SLOT_BAG_END) || (dstbag == INVENTORY_SLOT_BAG_0 && dstslot < INVENTORY_SLOT_BAG_END))
+ _player->ApplyItemDependentAuras((Item*)nullptr, false);
}
}