From 8d8ad35e172c33024820d75be5342880f13e6f03 Mon Sep 17 00:00:00 2001 From: Steve Date: Sun, 31 Jul 2016 09:58:06 +0100 Subject: [PATCH] Don't constantly fire lasers or mags at a disabled craft. --- src/battle/ai.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/battle/ai.c b/src/battle/ai.c index 3d6fc9c..218f20b 100644 --- a/src/battle/ai.c +++ b/src/battle/ai.c @@ -396,7 +396,12 @@ static int selectWeaponForTarget(Entity *e) if (e->flags & EF_NO_KILL) { - return selectWeapon(BT_LASER) || selectWeapon(BT_MAG); + if (!(e->flags & EF_DISABLED)) + { + return selectWeapon(BT_LASER) || selectWeapon(BT_MAG); + } + + return 0; } }