Save game when awarding trophies in Hub.

This commit is contained in:
Steve 2018-03-04 16:01:44 +00:00
parent 222147665e
commit 4c08307f18
2 changed files with 16 additions and 3 deletions

View File

@ -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();
}
}

View File

@ -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;