From 8831853321620ecf9b6089abbccf832bdc07a9ca Mon Sep 17 00:00:00 2001 From: Steve Date: Wed, 11 Nov 2015 22:32:00 +0000 Subject: [PATCH] Mark escaped entities as ALIVE_ESCAPED. --- src/battle/extractionPoint.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/battle/extractionPoint.c b/src/battle/extractionPoint.c index 7d301c0..6ee998a 100644 --- a/src/battle/extractionPoint.c +++ b/src/battle/extractionPoint.c @@ -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; + e->alive = ALIVE_ESCAPED; } - - i++; - - e = (i < MAX_GRID_CANDIDATES) ? candidates[i] : NULL; } }