mirror of
https://github.com/araxiaonline/TrinityCore2.git
synced 2026-06-16 21:09:50 -04:00
Force offhand weapon unequip when player doesn't have Dual Wield anymore
--HG-- branch : trunk
This commit is contained in:
@@ -3787,6 +3787,8 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank)
|
||||
|
||||
if (spell_id == 46917 && m_canTitanGrip)
|
||||
SetCanTitanGrip(false);
|
||||
if (spell_id == 674 && m_canDualWield)
|
||||
SetCanDualWield(false);
|
||||
|
||||
if (sWorld.getBoolConfig(CONFIG_OFFHAND_CHECK_AT_SPELL_UNLEARN))
|
||||
AutoUnequipOffhandIfNeed();
|
||||
@@ -21534,6 +21536,10 @@ void Player::AutoUnequipOffhandIfNeed(bool force /*= false*/)
|
||||
if (!offItem)
|
||||
return;
|
||||
|
||||
// unequip offhand weapon if player doesn't have dual wield anymore
|
||||
if (!CanDualWield() && (offItem->GetProto()->InventoryType == INVTYPE_WEAPONOFFHAND || offItem->GetProto()->InventoryType == INVTYPE_WEAPON))
|
||||
force = true;
|
||||
|
||||
// need unequip offhand for 2h-weapon without TitanGrip (in any from hands)
|
||||
if (!force && (CanTitanGrip() || (offItem->GetProto()->InventoryType != INVTYPE_2HWEAPON && !IsTwoHandUsed())))
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user