Force offhand weapon unequip when player doesn't have Dual Wield anymore

--HG--
branch : trunk
This commit is contained in:
Shocker
2010-08-24 08:19:17 +03:00
parent b2f542530f
commit 4a30a2815b

View File

@@ -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;