mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-26 20:11:47 +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_emblems();
|
||||||
//clear_levels();
|
//clear_levels();
|
||||||
doClearLevels = true;
|
doClearLevels = true;
|
||||||
|
|
||||||
|
G_ClearRecords();
|
||||||
|
M_ClearStats();
|
||||||
|
M_ClearSecrets();
|
||||||
}
|
}
|
||||||
else if (!mainfile && !gamedataadded)
|
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"))
|
if (M_CheckParm("-nodata"))
|
||||||
{
|
{
|
||||||
// Don't load at all.
|
// Don't load at all.
|
||||||
|
// The following used to be in M_ClearSecrets, but that was silly.
|
||||||
|
M_UpdateUnlockablesAndExtraEmblems(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (M_CheckParm("-resetdata"))
|
if (M_CheckParm("-resetdata"))
|
||||||
{
|
{
|
||||||
// Don't load, but do save. (essentially, reset)
|
// Don't load, but do save. (essentially, reset)
|
||||||
gamedata->loaded = true;
|
goto finalisegamedata;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (P_SaveBufferFromFile(&save, va(pandf, srb2home, gamedatafilename)) == false)
|
if (P_SaveBufferFromFile(&save, va(pandf, srb2home, gamedatafilename)) == false)
|
||||||
{
|
{
|
||||||
// No gamedata. We can save a new one.
|
// No gamedata. We can save a new one.
|
||||||
gamedata->loaded = true;
|
goto finalisegamedata;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Version check
|
// Version check
|
||||||
|
|
@ -4550,6 +4550,8 @@ void G_LoadGameData(void)
|
||||||
// done
|
// done
|
||||||
P_SaveBufferFree(&save);
|
P_SaveBufferFree(&save);
|
||||||
|
|
||||||
|
finalisegamedata:
|
||||||
|
|
||||||
// Don't consider loaded until it's a success!
|
// Don't consider loaded until it's a success!
|
||||||
// It used to do this much earlier, but this would cause the gamedata to
|
// 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,
|
// 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);
|
Z_Free(gamedata->challengegrid);
|
||||||
gamedata->challengegrid = NULL;
|
gamedata->challengegrid = NULL;
|
||||||
gamedata->challengegridwidth = 0;
|
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)
|
if (optionsmenu.erasecontext & EC_CHALLENGES)
|
||||||
M_ClearSecrets();
|
M_ClearSecrets();
|
||||||
|
|
||||||
|
M_UpdateUnlockablesAndExtraEmblems(false);
|
||||||
|
|
||||||
F_StartIntro();
|
F_StartIntro();
|
||||||
M_ClearMenus(true);
|
M_ClearMenus(true);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue