From 2920b00e9667c778898f969d2c7865a0f5d055ae Mon Sep 17 00:00:00 2001 From: Steve Date: Fri, 13 May 2016 09:05:27 +0100 Subject: [PATCH] Don't head for the jumpgate if retreating during a challenge. --- src/battle/fighters.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/battle/fighters.c b/src/battle/fighters.c index 1399112..c5c8cb5 100644 --- a/src/battle/fighters.c +++ b/src/battle/fighters.c @@ -645,8 +645,12 @@ void retreatEnemies(void) e->aiFlags |= AIF_AVOIDS_COMBAT; e->aiFlags |= AIF_UNLIMITED_RANGE; - e->aiFlags |= AIF_GOAL_JUMPGATE; e->aiFlags &= ~AIF_MOVES_TO_LEADER; + + if (!game.currentMission->challengeData.isChallenge) + { + e->aiFlags |= AIF_GOAL_JUMPGATE; + } } } } @@ -663,10 +667,14 @@ void retreatAllies(void) e->aiFlags |= AIF_AVOIDS_COMBAT; e->aiFlags |= AIF_UNLIMITED_RANGE; - e->aiFlags |= AIF_GOAL_JUMPGATE; e->aiFlags &= ~AIF_FOLLOWS_PLAYER; e->aiFlags &= ~AIF_MOVES_TO_PLAYER; e->aiFlags &= ~AIF_MOVES_TO_LEADER; + + if (!game.currentMission->challengeData.isChallenge) + { + e->aiFlags |= AIF_GOAL_JUMPGATE; + } } } }