From 886084f60fe4249f500d4db7d3eddcdc2ad068c1 Mon Sep 17 00:00:00 2001 From: Steve Date: Sat, 28 Nov 2015 15:30:07 +0000 Subject: [PATCH] Don't let AI fire missiles at point-blank range. --- src/battle/ai.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/battle/ai.c b/src/battle/ai.c index a069951..5bd2ab7 100644 --- a/src/battle/ai.c +++ b/src/battle/ai.c @@ -352,9 +352,11 @@ static void preAttack(void) { fireGuns(self); } - else if (self->missiles) + else if (self->missiles && getDistance(self->x, self->y, self->target->x, self->target->y) >= 350) { fireMissile(self); + + self->action = doAI; } } else