[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

@ -1683,7 +1683,7 @@ SpellEntry const* Creature::ReachWithSpellAttack(Unit* pVictim)
float range = GetSpellMaxRange(srange);
float minrange = GetSpellMinRange(srange);
float dist = GetCombatDistance(pVictim);
float dist = GetCombatDistance(pVictim, spellInfo->rangeIndex == SPELL_RANGE_IDX_COMBAT);
// if(!isInFront( pVictim, range ) && spellInfo->AttributesEx )
// continue;
@ -1739,7 +1739,7 @@ SpellEntry const* Creature::ReachWithSpellCure(Unit* pVictim)
float range = GetSpellMaxRange(srange);
float minrange = GetSpellMinRange(srange);
float dist = GetCombatDistance(pVictim);
float dist = GetCombatDistance(pVictim, spellInfo->rangeIndex == SPELL_RANGE_IDX_COMBAT);
// if(!isInFront( pVictim, range ) && spellInfo->AttributesEx )
// continue;
@ -2096,7 +2096,7 @@ bool Creature::MeetsSelectAttackingRequirement(Unit* pTarget, SpellEntry const*
SpellRangeEntry const* srange = sSpellRangeStore.LookupEntry(pSpellInfo->rangeIndex);
float max_range = GetSpellMaxRange(srange);
float min_range = GetSpellMinRange(srange);
float dist = GetCombatDistance(pTarget);
float dist = GetCombatDistance(pTarget, false);
return dist < max_range && dist >= min_range;
}