[7158] Added isAlive() check into Unit::SelectHostilTarget()

This can fix some unexpected behavior in some scripts which not checking alive state in main UpdateAI() method.
Signed-off-by: ApoC <apoc@nymfe.net>
This commit is contained in:
ApoC 2009-01-24 00:21:29 +01:00
parent 625f94ab35
commit c2a0a18a38
2 changed files with 3 additions and 1 deletions

View file

@ -9349,6 +9349,8 @@ bool Unit::SelectHostilTarget()
assert(GetTypeId()== TYPEID_UNIT); assert(GetTypeId()== TYPEID_UNIT);
if (!this->isAlive())
return false;
//This function only useful once AI has been initialized //This function only useful once AI has been initialized
if (!((Creature*)this)->AI()) if (!((Creature*)this)->AI())
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 "7157" #define REVISION_NR "7158"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__