From: Holger Schemel Date: Sun, 5 Jan 2025 21:40:45 +0000 (+0100) Subject: improved code logic (removed redundant condition) X-Git-Tag: 4.4.0.1~48 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=5da6916ff1df251bd2577d8e155e7be664d57ba1;p=rocksndiamonds.git improved code logic (removed redundant condition) --- diff --git a/src/game.c b/src/game.c index adb0d905..3e85cbc2 100644 --- a/src/game.c +++ b/src/game.c @@ -3745,16 +3745,16 @@ void InitGame(void) if (level.game_engine_type == GAME_ENGINE_TYPE_BD) { - if (setup.bd_multiple_lives && game_status == GAME_MODE_MAIN) + if (!setup.bd_multiple_lives) { - // 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; + // new BD game with normal, single life started (resetting global score is important here) + game_bd.global_lives = 0; game_bd.global_score = 0; } - else if (!setup.bd_multiple_lives) + else if (game_status == GAME_MODE_MAIN) { - // new BD game with normal, single life started (resetting global score is important here) - game_bd.global_lives = 0; + // 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; } }