GP Backup tidy (connected to ending gamestate)

- Handle removing GP Backups when any game end sequence is started, not just the Podium (in case no Podium exists)
- Guarantee removal in M_StartCup out-of-entries failure state
This commit is contained in:
toaster 2023-06-26 20:54:43 +01:00
parent d17399bcce
commit defd885092
3 changed files with 5 additions and 2 deletions

View file

@ -4651,6 +4651,8 @@ void G_EndGame(void)
// Only do evaluation and credits in singleplayer contexts // Only do evaluation and credits in singleplayer contexts
if (!netgame && grandprixinfo.gp == true) if (!netgame && grandprixinfo.gp == true)
{ {
G_HandleSaveLevel(true);
if (nextmap == NEXTMAP_CEREMONY) // end game with ceremony if (nextmap == NEXTMAP_CEREMONY) // end game with ceremony
{ {
if (K_StartCeremony() == true) if (K_StartCeremony() == true)

View file

@ -155,7 +155,8 @@ static void M_StartCup(UINT8 entry)
NULL, MM_NOTHING, NULL, NULL NULL, MM_NOTHING, NULL, NULL
); );
G_HandleSaveLevel(true); if (FIL_FileExists(gpbackup))
remove(gpbackup);
return; return;
} }

View file

@ -8358,7 +8358,7 @@ void P_PostLoadLevel(void)
P_RunCachedActions(); P_RunCachedActions();
G_HandleSaveLevel(gamestate == GS_CEREMONY); G_HandleSaveLevel(false);
if (marathonmode & MA_INGAME) if (marathonmode & MA_INGAME)
{ {