From dde34beedb6f50a50970e9948fd9981a309c0ada Mon Sep 17 00:00:00 2001 From: Steve Date: Sun, 17 Apr 2016 09:11:49 +0100 Subject: [PATCH] Tell retreating enemies to head for the jumpgate. --- src/battle/fighters.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/battle/fighters.c b/src/battle/fighters.c index 2cd1459..0950d5e 100644 --- a/src/battle/fighters.c +++ b/src/battle/fighters.c @@ -607,7 +607,12 @@ void retreatEnemies(void) { if (e->type == ET_FIGHTER && e->side != SIDE_ALLIES) { + e->flags |= EF_RETREATING; + e->aiFlags |= AIF_AVOIDS_COMBAT; + e->aiFlags |= AIF_UNLIMITED_RANGE; + e->aiFlags |= AIF_GOAL_JUMPGATE; + e->aiFlags &= ~AIF_MOVES_TO_LEADER; } } } @@ -627,6 +632,7 @@ void retreatAllies(void) e->aiFlags |= AIF_GOAL_JUMPGATE; e->aiFlags &= ~AIF_FOLLOWS_PLAYER; e->aiFlags &= ~AIF_MOVES_TO_PLAYER; + e->aiFlags &= ~AIF_MOVES_TO_LEADER; } } }