mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Player: Prevent changing equipment while charmed. Closes #20209.
(cherry picked from commit a1a12ec755)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user