[10571] Properly remove dual-wield flag at spell unlearn.

This commit is contained in:
VladimirMangos 2010-10-01 16:35:25 +04:00
parent a67b6a1da5
commit 85f8219ecf
2 changed files with 13 additions and 6 deletions

View file

@ -3580,19 +3580,26 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank, bo
}
}
if (CanTitanGrip())
// for Titan's Grip and shaman Dual-wield
if (CanDualWield() || CanTitanGrip())
{
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spell_id);
if (IsSpellHaveEffect(spellInfo, SPELL_EFFECT_TITAN_GRIP))
if (CanDualWield() && IsSpellHaveEffect(spellInfo, SPELL_EFFECT_DUAL_WIELD))
SetCanDualWield(false);
if (CanTitanGrip() && IsSpellHaveEffect(spellInfo, SPELL_EFFECT_TITAN_GRIP))
{
SetCanTitanGrip(false);
// Remove Titan's Grip damage penalty now
RemoveAurasDueToSpell(49152);
if(sWorld.getConfig(CONFIG_BOOL_OFFHAND_CHECK_AT_TALENTS_RESET))
AutoUnequipOffhandIfNeed();
}
}
// for talents and normal spell unlearn that allow offhand use for some weapons
if(sWorld.getConfig(CONFIG_BOOL_OFFHAND_CHECK_AT_TALENTS_RESET))
AutoUnequipOffhandIfNeed();
// remove from spell book if not replaced by lesser rank
if (!prev_activate && sendUpdate)
{
@ -20137,7 +20144,7 @@ void Player::AutoUnequipOffhandIfNeed()
return;
// need unequip offhand for 2h-weapon without TitanGrip (in any from hands)
if (CanTitanGrip() || (offItem->GetProto()->InventoryType != INVTYPE_2HWEAPON && !IsTwoHandUsed()))
if (CanDualWield() && (CanTitanGrip() || (offItem->GetProto()->InventoryType != INVTYPE_2HWEAPON && !IsTwoHandUsed())))
return;
ItemPosCountVec off_dest;