Core/Player: Prevent changing equipment while charmed. Closes #20209.

(cherry picked from commit a1a12ec755)
This commit is contained in:
Treeston
2017-09-05 15:33:44 +02:00
committed by Shauren
parent eccaf847c5
commit fc12e47cb8

View File

@@ -11469,6 +11469,9 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool
if (HasUnitState(UNIT_STATE_STUNNED))
return EQUIP_ERR_GENERIC_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
@@ -11670,6 +11673,9 @@ InventoryResult Player::CanUnequipItem(uint16 pos, bool swap) const
if (pItem->m_lootGenerated)
return EQUIP_ERR_LOOT_GONE;
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