[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);
if (!this->isAlive())
return false;
//This function only useful once AI has been initialized
if (!((Creature*)this)->AI())
return false;