[c12616] Simplify use of CombatReach

This commit is contained in:
Schmoozerd 2013-05-31 12:11:23 +01:00 committed by Antz
parent e478b27dcc
commit dc3de04d62
6 changed files with 36 additions and 22 deletions

View file

@ -56,7 +56,7 @@ CanCastResult CreatureAI::CanCastSpell(Unit* pTarget, const SpellEntry* pSpell,
if (pTarget != m_creature)
{
// pTarget is out of range of this spell (also done by Spell::CheckCast())
float fDistance = m_creature->GetCombatDistance(pTarget);
float fDistance = m_creature->GetCombatDistance(pTarget, pSpell->rangeIndex == SPELL_RANGE_IDX_COMBAT);
if (fDistance > (m_creature->IsHostileTo(pTarget) ? pSpellRange->maxRange : pSpellRange->maxRangeFriendly))
return CAST_FAIL_TOO_FAR;