From 4c08307f189ed5a7dcfd7b27f8cead6f16111225 Mon Sep 17 00:00:00 2001 From: Steve Date: Sun, 4 Mar 2018 16:01:44 +0000 Subject: [PATCH] Save game when awarding trophies in Hub. --- src/hub/hub.c | 15 ++++++++++++++- src/world/world.h | 4 ++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/hub/hub.c b/src/hub/hub.c index 74e84c1..223a1b0 100644 --- a/src/hub/hub.c +++ b/src/hub/hub.c @@ -693,10 +693,12 @@ static void loadMissions(void) static void awardMissionTrophies(void) { - int beach, greenlands, underground, outpost; + int beach, greenlands, underground, outpost, save; HubMission *mission; beach = greenlands = underground = outpost = 1; + + save = 0; for (mission = hubMissionHead.next ; mission != NULL ; mission = mission->next) { @@ -724,33 +726,44 @@ static void awardMissionTrophies(void) if (beach) { awardTrophy("BEACH"); + save = 1; } if (greenlands) { awardTrophy("GREENLANDS"); + save = 1; } if (underground) { awardTrophy("UNDERGROUND"); + save = 1; } if (outpost) { awardTrophy("OUTPOST"); + save = 1; } /* ignore training mission */ if (game.stats[STAT_MISSIONS_COMPLETE] == 2) { awardTrophy("CLEAN"); + save = 1; } /* ignore Teeka's */ if (game.totalMissions - game.stats[STAT_MISSIONS_COMPLETE] == 1) { awardTrophy("FULLY_CLEAN"); + save = 1; + } + + if (save) + { + saveGame(); } } diff --git a/src/world/world.h b/src/world/world.h index 214eddd..b3e3c64 100644 --- a/src/world/world.h +++ b/src/world/world.h @@ -40,6 +40,8 @@ extern void cameraTrack(Entity *e); extern void clearControl(int type); extern void clearControls(void); extern void clearScreen(void); +extern void clipCamera(void); +extern int collision(int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2); extern Entity *createEntity(char *typeStr); extern void destroyEntities(void); extern void destroyObjectives(void); @@ -114,8 +116,6 @@ extern int rrnd(int low, int high); extern void showWidgetGroup(char *group); extern void startSectionTransition(void); extern void stopMusic(void); -extern int collision(int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2); -extern void clipCamera(void); extern App app; extern Camera camera;