mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[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:
parent
625f94ab35
commit
c2a0a18a38
2 changed files with 3 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue