From d3091caed5f35d0763eb205fc8eaf467c894ab56 Mon Sep 17 00:00:00 2001 From: Steve Date: Tue, 17 May 2016 11:34:08 +0100 Subject: [PATCH] Don't circle your destination if you're near it. --- src/battle/ai.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle/ai.c b/src/battle/ai.c index 1aeb2b1..e5ed9a7 100644 --- a/src/battle/ai.c +++ b/src/battle/ai.c @@ -957,7 +957,7 @@ static void wander(void) { moveToTargetLocation(); - if (nearEnemies()) + if (nearEnemies() || getDistance(self->x, self->y, self->targetLocation.x, self->targetLocation.y) <= 100) { self->aiActionTime = 0; }