From 7812c16db4e1523db25e94254e23ab2d6a6827d0 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Fri, 8 Mar 2024 20:30:17 +0100 Subject: [PATCH] added special handling of BD intermission levels on game over This change is required if asking for restart after gave over is disabled in the setup menu. --- src/game.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/game.c b/src/game.c index db689084..9127a1b6 100644 --- a/src/game.c +++ b/src/game.c @@ -5162,7 +5162,11 @@ void GameEnd(void) int last_level_nr = levelset.level_nr; boolean tape_saved = FALSE; - game.LevelSolved_GameEnd = TRUE; + // Important note: This function is not only called after "GameWon()", but also after + // "game over" (if automatically asking for restarting the game is disabled in setup) + + if (game.LevelSolved) + game.LevelSolved_GameEnd = TRUE; if (game.LevelSolved_SaveTape && !score_info_tape_play) { @@ -5189,7 +5193,7 @@ void GameEnd(void) return; } - if (!game.LevelSolved_SaveScore) + if (!game.GamePlayed || (!game.LevelSolved_SaveScore && !level.bd_intermission)) { SetGameStatus(GAME_MODE_MAIN); @@ -5206,12 +5210,13 @@ void GameEnd(void) } // save score and score tape before potentially erasing tape below - NewHighScore(last_level_nr, tape_saved); + if (game.LevelSolved_SaveScore) + NewHighScore(last_level_nr, tape_saved); // increment and load next level (if possible and not configured otherwise) AdvanceToNextLevel(); - if (scores.last_added >= 0 && setup.show_scores_after_game) + if (game.LevelSolved_SaveScore && scores.last_added >= 0 && setup.show_scores_after_game) { SetGameStatus(GAME_MODE_SCORES); -- 2.34.1