From 1306268847ce054bb682d5c59c6fdc13ac262027 Mon Sep 17 00:00:00 2001 From: Steve Date: Fri, 13 May 2016 09:05:42 +0100 Subject: [PATCH] Retreat allies and enemies at end of challenge, so they don't keep fighting. --- src/challenges/challenges.c | 8 ++++++++ src/challenges/challenges.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/src/challenges/challenges.c b/src/challenges/challenges.c index 4823bfb..114dbf9 100644 --- a/src/challenges/challenges.c +++ b/src/challenges/challenges.c @@ -494,6 +494,10 @@ static void completeChallenge(void) player->flags |= EF_IMMORTAL; + retreatAllies(); + + retreatEnemies(); + awardStatsTrophies(); } } @@ -513,6 +517,10 @@ static void failChallenge(void) battle.status = MS_TIME_UP; } + retreatAllies(); + + retreatEnemies(); + awardStatsTrophies(); } } diff --git a/src/challenges/challenges.h b/src/challenges/challenges.h index 6a5d6b0..169073c 100644 --- a/src/challenges/challenges.h +++ b/src/challenges/challenges.h @@ -31,6 +31,8 @@ extern void updateAccuracyStats(unsigned int *stats); extern int getJSONValue(cJSON *node, char *name, int defValue); extern long lookup(char *name); extern void awardStatsTrophies(void); +extern void retreatAllies(void); +extern void retreatEnemies(void); extern Dev dev; extern Battle battle;