From 4a30a2815b53229cb092db2e1cd37c6877bbd604 Mon Sep 17 00:00:00 2001 From: Shocker Date: Tue, 24 Aug 2010 08:19:17 +0300 Subject: Force offhand weapon unequip when player doesn't have Dual Wield anymore --HG-- branch : trunk --- src/server/game/Entities/Player/Player.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 4bb81156930..775489c2266 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -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; -- cgit v1.2.3