Save game more frequently, for stats and trophies.

This commit is contained in:
Steve 2016-04-30 11:20:24 +01:00
parent c6d598da6c
commit a656d41532
4 changed files with 6 additions and 1 deletions

View File

@ -387,6 +387,8 @@ static void postBattle(void)
game.stats[STAT_EPIC_KILL_STREAK] = MAX(game.stats[STAT_EPIC_KILL_STREAK], battle.stats[STAT_EPIC_KILL_STREAK]);
updateAccuracyStats(game.stats);
saveGame();
}
void destroyBattle(void)

View File

@ -85,9 +85,9 @@ extern void updateAccuracyStats(unsigned int *stats);
extern void clearInput(void);
extern void runScriptFunction(const char *format, ...);
extern void doSpawners(void);
extern void awardPostMissionTrophies(void);
extern void doTrophyAlerts(void);
extern void drawTrophyAlert(void);
extern void saveGame(void);
extern App app;
extern Battle battle;

View File

@ -313,6 +313,8 @@ void saveConfig(void)
void cleanup(void)
{
saveGame();
SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, "Cleaning up ...");
SDL_DestroyRenderer(app.renderer);

View File

@ -71,6 +71,7 @@ extern char *getLookupName(char *prefix, long num);
extern long lookup(char *name);
extern void initStars(void);
extern void initTrophies(void);
extern void saveGame(void);
extern App app;
extern Colors colors;