mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-28 13:21:10 +00:00
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:
parent
e85e621d2c
commit
4abb03a231
2 changed files with 4 additions and 3 deletions
|
@ -2293,10 +2293,8 @@ static inline void G_PlayerFinishLevel(INT32 player)
|
||||||
{
|
{
|
||||||
matchesplayed++;
|
matchesplayed++;
|
||||||
if (M_UpdateUnlockablesAndExtraEmblems(true))
|
if (M_UpdateUnlockablesAndExtraEmblems(true))
|
||||||
{
|
|
||||||
S_StartSound(NULL, sfx_ncitem);
|
S_StartSound(NULL, sfx_ncitem);
|
||||||
G_SaveGameData(true); // only save if unlocked something
|
G_SaveGameData(true);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
legitimateexit = false;
|
legitimateexit = false;
|
||||||
|
|
|
@ -712,6 +712,9 @@ static void Y_UpdateRecordReplays(void)
|
||||||
if ((earnedEmblems = M_CheckLevelEmblems()))
|
if ((earnedEmblems = M_CheckLevelEmblems()))
|
||||||
CONS_Printf(M_GetText("\x82" "Earned %hu medal%s for Record Attack records.\n"), (UINT16)earnedEmblems, earnedEmblems > 1 ? "s" : "");
|
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.
|
// Update timeattack menu's replay availability.
|
||||||
CV_AddValue(&cv_nextmap, 1);
|
CV_AddValue(&cv_nextmap, 1);
|
||||||
CV_AddValue(&cv_nextmap, -1);
|
CV_AddValue(&cv_nextmap, -1);
|
||||||
|
|
Loading…
Reference in a new issue