[11850] Add additional flag SELECT_FLAG_NOT_IN_MELEE_RANGE

this allows to select targets that are not in melee range with SelectAttackingTarget

Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This commit is contained in:
PSZ 2011-11-28 16:32:58 +01:00 committed by Schmoozerd
parent 93c419460f
commit f9a259dc44
3 changed files with 11 additions and 8 deletions

View file

@ -2041,6 +2041,8 @@ bool Creature::MeetsSelectAttackingRequirement(Unit* pTarget, SpellEntry const*
if (selectFlags & SELECT_FLAG_IN_MELEE_RANGE && !CanReachWithMeleeAttack(pTarget))
return false;
if (selectFlags & SELECT_FLAG_NOT_IN_MELEE_RANGE && CanReachWithMeleeAttack(pTarget))
return false;
if (selectFlags & SELECT_FLAG_IN_LOS && !IsWithinLOSInMap(pTarget))
return false;