From: Holger Schemel Date: Fri, 8 Mar 2024 19:30:17 +0000 (+0100) Subject: added special handling of BD intermission levels on game over X-Git-Tag: 4.4.0.0-test-1~229 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=7812c16db4e1523db25e94254e23ab2d6a6827d0;p=rocksndiamonds.git 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. --- 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);