From: Holger Schemel Date: Sat, 6 May 2017 22:14:54 +0000 (+0200) Subject: added check to only count down time/health if this adds to the score X-Git-Tag: 4.1.0.0~117 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=7e09f70a8285f2d1e905bf1c75585523f347acad;p=rocksndiamonds.git added check to only count down time/health if this adds to the score --- diff --git a/src/game.c b/src/game.c index b9e35f07..df0f2961 100644 --- a/src/game.c +++ b/src/game.c @@ -4506,7 +4506,7 @@ void GameWon() TapeStop(); - game_over_delay_1 = game_over_delay_value_1; + game_over_delay_1 = 0; game_over_delay_2 = 0; game_over_delay_3 = game_over_delay_value_3; @@ -4514,27 +4514,32 @@ void GameWon() score = score_final = local_player->score_final; health = health_final = local_player->health_final; - if (TimeLeft > 0) + if (level.score[SC_TIME_BONUS] > 0) { - time_final = 0; - score_final += TimeLeft * level.score[SC_TIME_BONUS]; - } - else if (game.no_time_limit && TimePlayed < 999) - { - time_final = 999; - score_final += (999 - TimePlayed) * level.score[SC_TIME_BONUS]; - } + if (TimeLeft > 0) + { + time_final = 0; + score_final += TimeLeft * level.score[SC_TIME_BONUS]; + } + else if (game.no_time_limit && TimePlayed < 999) + { + time_final = 999; + score_final += (999 - TimePlayed) * level.score[SC_TIME_BONUS]; + } - if (level.game_engine_type == GAME_ENGINE_TYPE_MM) - { - health_final = 0; - score_final += health * level.score[SC_TIME_BONUS]; + game_over_delay_1 = game_over_delay_value_1; - game_over_delay_2 = game_over_delay_value_2; - } + if (level.game_engine_type == GAME_ENGINE_TYPE_MM) + { + health_final = 0; + score_final += health * level.score[SC_TIME_BONUS]; - local_player->score_final = score_final; - local_player->health_final = health_final; + game_over_delay_2 = game_over_delay_value_2; + } + + local_player->score_final = score_final; + local_player->health_final = health_final; + } if (level_editor_test_game) {