From a96e39b22fc3f8b4d7453ac4b3c961b977977024 Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 9 Mar 2024 14:34:48 +0000 Subject: [PATCH] G_UpdateVisited, G_DoCompleted: Clean up tutorialchallenge behaviour - Permit saving "this map has been beaten" for the Tutorial Challenge map if you conquered it - This was previously short circuited because it wasn't a dedicated course - Only trigger an extra UpdateUnlockablesAndExtraEmblems check if you haven't yet completed it --- src/g_game.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index ea74704aa..8a21fa8e4 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -3782,7 +3782,7 @@ void G_UpdateVisited(void) return; // Neither for tutorial skip material - if (nextmapoverride == NEXTMAP_TUTORIALCHALLENGE+1 || tutorialchallenge != TUTORIALSKIP_NONE) + if (tutorialchallenge != TUTORIALSKIP_NONE) return; // Check if every local player wiped out. @@ -4545,24 +4545,26 @@ static void G_DoCompleted(void) else { // Proceed. + // ~toast 161123 (5 years of srb2kart, woooouuuu) nextmapoverride = NEXTMAP_TITLE+1; + tutorialchallenge = TUTORIALSKIP_NONE; - gamedata->finishedtutorialchallenge = true; + if (!gamedata->finishedtutorialchallenge) + { + gamedata->finishedtutorialchallenge = true; - M_UpdateUnlockablesAndExtraEmblems(true, true); - gamedata->deferredsave = true; + M_UpdateUnlockablesAndExtraEmblems(true, true); + gamedata->deferredsave = true; + } } } else { - // The "else" might not be strictly needed, but I don't - // want the "challenge" map to be considered visited before it's your time. - // ~toast 161123 (5 years of srb2kart, woooouuuu) - prevmap = gamemap-1; tutorialchallenge = TUTORIALSKIP_NONE; } // This can now be set. + prevmap = gamemap-1; legitimateexit = false; if (!demo.playback)