From 0605da87eee5835bce27764024dfc6303852b243 Mon Sep 17 00:00:00 2001 From: Steve Date: Tue, 20 Mar 2018 19:26:14 +0000 Subject: [PATCH] Handle end of game in post mission. --- src/hub/postMission.c | 23 +++++++++++------------ src/hub/postMission.h | 1 + src/world/world.c | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/hub/postMission.c b/src/hub/postMission.c index 0f0da7a..5f50aee 100644 --- a/src/hub/postMission.c +++ b/src/hub/postMission.c @@ -41,7 +41,17 @@ void initPostMission(void) updateMissionStatus(); - if (world.state != WS_QUIT) + if (world.state == WS_GAME_COMPLETE) + { + saveGame(); + + saveWorld(); + + destroyWorld(); + + initEnding(); + } + else if (world.state != WS_QUIT) { app.restrictTrophyAlert = 0; @@ -101,17 +111,6 @@ void returnToHub(void) initHub(); } -void returnToTitle(void) -{ - restoreGameState(); - - saveGame(); - - destroyWorld(); - - initTitle(); -} - static void updateMissionStatus(void) { Tuple *t; diff --git a/src/hub/postMission.h b/src/hub/postMission.h index 611bc3e..98c317a 100644 --- a/src/hub/postMission.h +++ b/src/hub/postMission.h @@ -37,6 +37,7 @@ extern void restoreGameState(void); extern void saveGame(void); extern void saveWorld(void); extern void startSectionTransition(void); +extern void initEnding(void); extern App app; extern Colors colors; diff --git a/src/world/world.c b/src/world/world.c index 0c22b2d..94d2ba5 100644 --- a/src/world/world.c +++ b/src/world/world.c @@ -552,7 +552,7 @@ static void doGameComplete(void) { if (--world.missionCompleteTimer <= 0) { - initEnding(); + initPostMission(); } else {