mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-22 02:00:11 +00:00
Clear records, stats, and secrets on new in-SOC gamedata creation
- Pre-emptive sanity check to some impending work - Move M_UpdateUnlockablesAndExtraEmblems out of M_ClearSecrets
This commit is contained in:
parent
5296ab1397
commit
f7617e7530
4 changed files with 12 additions and 7 deletions
|
|
@ -2768,6 +2768,10 @@ void readmaincfg(MYFILE *f, boolean mainfile)
|
|||
clear_emblems();
|
||||
//clear_levels();
|
||||
doClearLevels = true;
|
||||
|
||||
G_ClearRecords();
|
||||
M_ClearStats();
|
||||
M_ClearSecrets();
|
||||
}
|
||||
else if (!mainfile && !gamedataadded)
|
||||
{
|
||||
|
|
|
|||
10
src/g_game.c
10
src/g_game.c
|
|
@ -4371,21 +4371,21 @@ void G_LoadGameData(void)
|
|||
if (M_CheckParm("-nodata"))
|
||||
{
|
||||
// Don't load at all.
|
||||
// The following used to be in M_ClearSecrets, but that was silly.
|
||||
M_UpdateUnlockablesAndExtraEmblems(false);
|
||||
return;
|
||||
}
|
||||
|
||||
if (M_CheckParm("-resetdata"))
|
||||
{
|
||||
// Don't load, but do save. (essentially, reset)
|
||||
gamedata->loaded = true;
|
||||
return;
|
||||
goto finalisegamedata;
|
||||
}
|
||||
|
||||
if (P_SaveBufferFromFile(&save, va(pandf, srb2home, gamedatafilename)) == false)
|
||||
{
|
||||
// No gamedata. We can save a new one.
|
||||
gamedata->loaded = true;
|
||||
return;
|
||||
goto finalisegamedata;
|
||||
}
|
||||
|
||||
// Version check
|
||||
|
|
@ -4550,6 +4550,8 @@ void G_LoadGameData(void)
|
|||
// done
|
||||
P_SaveBufferFree(&save);
|
||||
|
||||
finalisegamedata:
|
||||
|
||||
// Don't consider loaded until it's a success!
|
||||
// It used to do this much earlier, but this would cause the gamedata to
|
||||
// save over itself when it I_Errors from the corruption landing point below,
|
||||
|
|
|
|||
|
|
@ -554,9 +554,6 @@ void M_ClearSecrets(void)
|
|||
Z_Free(gamedata->challengegrid);
|
||||
gamedata->challengegrid = NULL;
|
||||
gamedata->challengegridwidth = 0;
|
||||
|
||||
// Re-unlock any always unlocked things
|
||||
M_UpdateUnlockablesAndExtraEmblems(false);
|
||||
}
|
||||
|
||||
// ----------------------
|
||||
|
|
|
|||
|
|
@ -66,6 +66,8 @@ static void M_EraseDataResponse(INT32 ch)
|
|||
if (optionsmenu.erasecontext & EC_CHALLENGES)
|
||||
M_ClearSecrets();
|
||||
|
||||
M_UpdateUnlockablesAndExtraEmblems(false);
|
||||
|
||||
F_StartIntro();
|
||||
M_ClearMenus(true);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue