Mark escaped entities as ALIVE_ESCAPED.

This commit is contained in:
Steve 2015-11-11 22:32:00 +00:00
parent 96641ffbd4
commit 8831853321
1 changed files with 2 additions and 9 deletions

View File

@ -57,19 +57,12 @@ static void handleFleeingEntities(void)
int i;
candidates = getAllEntsWithin(self->x, self->y, self->w, self->h, self);
i = 0;
e = candidates[i];
while (e)
for (i = 0, e = candidates[i] ; e != NULL ; i++, e = candidates[i])
{
if (e->health > 0 && e->flags & EF_FLEEING && getDistance(e->x, e->y, self->x, self->y) <= 64)
{
e->alive = ALIVE_DEAD;
}
i++;
e = (i < MAX_GRID_CANDIDATES) ? candidates[i] : NULL;
e->alive = ALIVE_ESCAPED;
}
}
}