Prevent fighters from magically coming back to life if their target is kill while they are also dying.

This commit is contained in:
Steve 2015-11-01 11:37:12 +00:00
parent 5466bb2ea5
commit 2a38221bcf
3 changed files with 17 additions and 17 deletions

View File

@ -51,6 +51,12 @@ void doAI(void)
{
int r;
if (self->target != NULL && self->target->health <= 0)
{
self->action = self->defaultAction;
self->target = NULL;
}
if (!self->target || targetOutOfRange() || self->target->systemPower <= 0)
{
findTarget();

View File

@ -56,12 +56,6 @@ void doEntities(void)
e->x += e->dx;
e->y += e->dy;
if (e->target != NULL && e->target->health <= 0)
{
e->action = e->defaultAction;
e->target = NULL;
}
if (e->action != NULL)
{
if (--e->thinkTime <= 0)

View File

@ -155,13 +155,13 @@ static void randomizeDartGuns(Entity *dart)
void doFighter(void)
{
if (self != player && self->health > 0)
if (self->alive == ALIVE_ALIVE)
{
separate();
}
if (self != player)
{
separate();
}
if (self->health > 0)
{
self->reload = MAX(self->reload - 1, 0);
self->shieldRecharge = MAX(self->shieldRecharge - 1, 0);
self->armourHit = MAX(self->armourHit - 25, 0);
@ -183,10 +183,7 @@ void doFighter(void)
{
self->action = self->defaultAction;
}
}
if (self->alive == ALIVE_ALIVE)
{
if (self->health <= 0)
{
self->health = 0;
@ -239,7 +236,10 @@ void doFighter(void)
{
battle.stats[STAT_ALLIES_KILLED]++;
addHudMessage(colors.red, "Ally has been killed");
if (!battle.epic)
{
addHudMessage(colors.red, "Ally has been killed");
}
}
}