From d329fbaf2f6a3c413c6d76c07b5fa75bedd2aeb4 Mon Sep 17 00:00:00 2001 From: Steve Date: Fri, 1 Apr 2016 17:02:56 +0100 Subject: [PATCH] Only deploy mines if you're moving. --- src/battle/ai.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/battle/ai.c b/src/battle/ai.c index 5416d84..1f392ab 100644 --- a/src/battle/ai.c +++ b/src/battle/ai.c @@ -628,14 +628,18 @@ static void deployMine(void) { Entity *mine; - if (!self->reload) + if (!self->reload && self->thrust > 0) { mine = spawnMine(); mine->x = self->x; mine->y = self->y; + mine->dx = rand() % 20 - rand() % 20; + mine->dx *= 0.1; + mine->dy = rand() % 20 - rand() % 20; + mine->dy *= 0.1; mine->side = self->side; - self->reload = FPS + (FPS * (rand() % 5)); + self->reload = rand() % (FPS * 3); } }