Two tweaks to gamedata saving:

* Save gamedata in Y_UpdateRecordReplays(), so that you never unfairly lose out on your spoils by setting modifiedgame before the game ends.
* Always save your matchesplayed/totalplaytime increase at the successful completion of a level.
This commit is contained in:
toaster 2018-11-17 20:16:27 +00:00
parent e85e621d2c
commit 4abb03a231
2 changed files with 4 additions and 3 deletions

View file

@ -2293,10 +2293,8 @@ static inline void G_PlayerFinishLevel(INT32 player)
{
matchesplayed++;
if (M_UpdateUnlockablesAndExtraEmblems(true))
{
S_StartSound(NULL, sfx_ncitem);
G_SaveGameData(true); // only save if unlocked something
}
G_SaveGameData(true);
}
legitimateexit = false;

View file

@ -712,6 +712,9 @@ static void Y_UpdateRecordReplays(void)
if ((earnedEmblems = M_CheckLevelEmblems()))
CONS_Printf(M_GetText("\x82" "Earned %hu medal%s for Record Attack records.\n"), (UINT16)earnedEmblems, earnedEmblems > 1 ? "s" : "");
// SRB2Kart - save here so you NEVER lose your earned times/medals.
G_SaveGameData(false);
// Update timeattack menu's replay availability.
CV_AddValue(&cv_nextmap, 1);
CV_AddValue(&cv_nextmap, -1);