From: Holger Schemel Date: Fri, 3 Jan 2025 23:16:06 +0000 (+0100) Subject: minor code change (no functional change) X-Git-Tag: 4.4.0.1~60 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=c999197cbbb4e5f174cea504d558def02613c27b;p=rocksndiamonds.git minor code change (no functional change) --- diff --git a/src/game.c b/src/game.c index d0ba9492..af5b0e2c 100644 --- a/src/game.c +++ b/src/game.c @@ -5224,17 +5224,27 @@ void GameEnd(void) // 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) - // do not handle game end if game over and automatically asking for game restart - if (game.GamePlayed && game_over && setup.ask_on_game_over) + if (game.GamePlayed && game_over) { - // (this is a special case: player pressed "return" key or fire button shortly before - // automatically asking to restart the game, so skip asking and restart right away) + boolean restart_game = FALSE; - CloseDoor(DOOR_CLOSE_1); + if (setup.ask_on_game_over) + { + // do not handle game end if game over and automatically asking for game restart + // (this is a special case: player pressed "return" key or fire button shortly before + // automatically asking to restart the game, so skip asking and restart right away) - StartGameActions(network.enabled, setup.autorecord, level.random_seed); + restart_game = TRUE; + } - return; + if (restart_game) + { + CloseDoor(DOOR_CLOSE_1); + + StartGameActions(network.enabled, setup.autorecord, level.random_seed); + + return; + } } // do not handle game end if request dialog is already active