[8323] Check for unitState follow in selectHostilTarget to prevent unexpected enterEvadeMode.

Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
NoFantasy 2009-08-06 10:57:15 +02:00
parent 0449aadc74
commit 4574d64008
2 changed files with 3 additions and 3 deletions

View file

@ -9860,11 +9860,11 @@ bool Unit::SelectHostilTarget()
// it in combat but attacker not make any damage and not enter to aggro radius to have record in threat list // it in combat but attacker not make any damage and not enter to aggro radius to have record in threat list
// for example at owner command to pet attack some far away creature // for example at owner command to pet attack some far away creature
// Note: creature not have targeted movement generator but have attacker in this case // Note: creature not have targeted movement generator but have attacker in this case
if( GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE ) if (GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE || hasUnitState(UNIT_STAT_FOLLOW))
{ {
for(AttackerSet::const_iterator itr = m_attackers.begin(); itr != m_attackers.end(); ++itr) for(AttackerSet::const_iterator itr = m_attackers.begin(); itr != m_attackers.end(); ++itr)
{ {
if( (*itr)->IsInMap(this) && (*itr)->isTargetableForAttack() && (*itr)->isInAccessablePlaceFor((Creature*)this) ) if ((*itr)->IsInMap(this) && (*itr)->isTargetableForAttack() && (*itr)->isInAccessablePlaceFor((Creature*)this))
return false; return false;
} }
} }

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 "8322" #define REVISION_NR "8323"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__