From: Holger Schemel Date: Sun, 5 Jan 2025 21:41:58 +0000 (+0100) Subject: improved support for restart key when playing BD games with multiple lives X-Git-Tag: 4.4.0.1~47 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=2f2fdbb5675da179e0f0e664946d542d534e3e8c;p=rocksndiamonds.git improved support for restart key when playing BD games with multiple lives --- diff --git a/src/game.c b/src/game.c index 3e85cbc2..186e7749 100644 --- a/src/game.c +++ b/src/game.c @@ -3747,13 +3747,20 @@ void InitGame(void) { if (!setup.bd_multiple_lives) { - // new BD game with normal, single life started (resetting global score is important here) + // newly started BD game with normal, single life (resetting global score is important here) game_bd.global_lives = 0; game_bd.global_score = 0; } - else if (game_status == GAME_MODE_MAIN) + else if (restarting && game_bd.global_lives > 1) { - // new BD game with multiple lives started, so set initial number of lives and global score + // restarted BD game with multiple (and remaining) lives, so decrement number of lives + // (also for intermissions; extra life will be added again later) + game_bd.global_lives--; + } + else if (restarting || game_status == GAME_MODE_MAIN) + { + // newly started BD game with multiple lives (or restarted BD game, but no remaining lives), + // so set initial number of lives and reset global score game_bd.global_lives = level.native_bd_level->caveset->initial_lives; game_bd.global_score = 0; } diff --git a/src/tape.c b/src/tape.c index cefc170f..35140ad4 100644 --- a/src/tape.c +++ b/src/tape.c @@ -1414,22 +1414,6 @@ void TapeRestartGame(void) if (!checkRestartGame("Restart game?")) return; - if (level.game_engine_type == GAME_ENGINE_TYPE_BD && - setup.bd_multiple_lives && game_status == GAME_MODE_PLAYING) - { - if (game_bd.global_lives > 1) - { - // decrement number of lives (also for intermissions; will be added later) - game_bd.global_lives--; - } - else - { - // new BD game with multiple lives started, so set initial number of lives and global score - game_bd.global_lives = level.native_bd_level->caveset->initial_lives; - game_bd.global_score = 0; - } - } - StartGameActions(network.enabled, setup.autorecord, level.random_seed); }