Only reset fighter AI if said fighter is alive.

This commit is contained in:
Steve 2018-10-29 22:47:39 +00:00
parent 07095f6346
commit fba16a8009
1 changed files with 1 additions and 1 deletions

View File

@ -541,7 +541,7 @@ void damageFighter(Entity *e, int amount, long flags)
/*
* Sometimes run away if you take too much damage in a short space of time
*/
if (e->type == ET_FIGHTER && (!(e->aiFlags & AIF_EVADE)) && e != player && e->aiDamagePerSec >= (e->maxHealth + e->maxShield) * 0.1)
if (e->type == ET_FIGHTER && e->alive == ALIVE_ALIVE && (!(e->aiFlags & AIF_EVADE)) && e != player && e->aiDamagePerSec >= (e->maxHealth + e->maxShield) * 0.1)
{
if ((rand() % 10) > 7)
{