[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)) if (selectFlags & SELECT_FLAG_IN_MELEE_RANGE && !CanReachWithMeleeAttack(pTarget))
return false; return false;
if (selectFlags & SELECT_FLAG_NOT_IN_MELEE_RANGE && CanReachWithMeleeAttack(pTarget))
return false;
if (selectFlags & SELECT_FLAG_IN_LOS && !IsWithinLOSInMap(pTarget)) if (selectFlags & SELECT_FLAG_IN_LOS && !IsWithinLOSInMap(pTarget))
return false; return false;

View file

@ -305,6 +305,7 @@ enum SelectFlags
SELECT_FLAG_POWER_ENERGY = 0x010, SELECT_FLAG_POWER_ENERGY = 0x010,
SELECT_FLAG_POWER_RUNIC = 0x020, SELECT_FLAG_POWER_RUNIC = 0x020,
SELECT_FLAG_IN_MELEE_RANGE = 0x040, SELECT_FLAG_IN_MELEE_RANGE = 0x040,
SELECT_FLAG_NOT_IN_MELEE_RANGE = 0x080,
}; };
// Vendors // Vendors

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "11849" #define REVISION_NR "11850"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__