aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2017-09-05 15:33:44 +0200
committerTreeston <treeston.mmoc@gmail.com>2017-09-05 15:33:44 +0200
commita1a12ec755e4aa5e2e8475d6a6158bac94f0977a (patch)
tree2f8ff142c8c77c35dfaa4a02b9bdba7f61a5a04f
parent310cc50cd1f8747bfb4a5e3fdd02a74b066cf701 (diff)
Core/Player: Prevent changing equipment while charmed. Closes #20209.
-rw-r--r--src/server/game/Entities/Player/Player.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 06cc0f6c4d4..393a363c147 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -11198,6 +11198,9 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool
if (HasUnitState(UNIT_STATE_STUNNED))
return EQUIP_ERR_YOU_ARE_STUNNED;
+ if (IsCharmed())
+ return EQUIP_ERR_CANT_DO_RIGHT_NOW; // @todo is this the correct error?
+
// do not allow equipping gear except weapons, offhands, projectiles, relics in
// - combat
// - in-progress arenas
@@ -11355,6 +11358,9 @@ InventoryResult Player::CanUnequipItem(uint16 pos, bool swap) const
if (pItem->m_lootGenerated)
return EQUIP_ERR_ALREADY_LOOTED;
+ if (IsCharmed())
+ return EQUIP_ERR_CANT_DO_RIGHT_NOW; // @todo is this the correct error?
+
// do not allow unequipping gear except weapons, offhands, projectiles, relics in
// - combat
// - in-progress arenas