Core/Spell: added some helpers to SpellInfo to reduce code duplication

This commit is contained in:
ariel-
2016-12-30 23:50:28 -03:00
parent 90a330c910
commit 14c2b2d6cd
5 changed files with 69 additions and 62 deletions
+2 -9
View File
@@ -836,17 +836,10 @@ void Player::UpdateExpertise(WeaponAttackType attack)
int32 expertise = int32(GetRatingBonusValue(CR_EXPERTISE));
Item* weapon = GetWeaponForAttack(attack, true);
Item const* weapon = GetWeaponForAttack(attack, true);
expertise += GetTotalAuraModifier(SPELL_AURA_MOD_EXPERTISE, [weapon](AuraEffect const* aurEff) -> bool
{
// item neutral spell
if (aurEff->GetSpellInfo()->EquippedItemClass == -1)
return true;
// item dependent spell
else if (weapon && weapon->IsFitToSpellRequirements(aurEff->GetSpellInfo()))
return true;
return false;
return aurEff->GetSpellInfo()->IsItemFitToSpellRequirements(weapon);
});
if (expertise < 0)