From 85364c6f558921a637074563ecd46f111bc8b8e5 Mon Sep 17 00:00:00 2001 From: Steve Date: Fri, 30 Oct 2015 22:38:01 +0000 Subject: [PATCH] Available guns bug fix. --- src/battle/ai.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/battle/ai.c b/src/battle/ai.c index a8d0087..9763e4c 100644 --- a/src/battle/ai.c +++ b/src/battle/ai.c @@ -289,11 +289,11 @@ static void preAttack(void) { if (!self->reload) { - if (self->missiles.ammo == 0 || (rand() % 50) > 0) + if (self->guns[0].type && (self->missiles.ammo == 0 || (rand() % 50) > 0)) { fireGuns(self); } - else + else if (self->missiles.ammo) { fireMissile(self); }