mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +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);
|
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;
|
||||||
|
|
|
||||||
|
|
@ -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__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue