From: Holger Schemel Date: Mon, 2 Jan 2023 11:45:35 +0000 (+0100) Subject: fixed bug that prevents playing levels without time limit in MM engine X-Git-Tag: 4.3.5.0~57 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=e4ab53e36bb4fe4ccf5aa82b2279dcaebc3df624;p=rocksndiamonds.git fixed bug that prevents playing levels without time limit in MM engine --- diff --git a/src/game_mm/mm_game.c b/src/game_mm/mm_game.c index 01c490a9..d001df01 100644 --- a/src/game_mm/mm_game.c +++ b/src/game_mm/mm_game.c @@ -3202,22 +3202,21 @@ static void GameActions_MM_Ext(void) if (game_mm.game_over) return; + if (game_mm.energy_left == 0 && !game.no_level_time_limit && game.time_limit) + { + FadeOutLaser(); + + GameOver_MM(GAME_OVER_NO_ENERGY); + + return; + } + if (FrameReached(&energy_delay)) { if (game_mm.energy_left > 0) - { game_mm.energy_left--; - redraw_mask |= REDRAW_DOOR_1; - } - else if (game.time_limit && !game_mm.game_over) - { - FadeOutLaser(); - - GameOver_MM(GAME_OVER_NO_ENERGY); - - return; - } + // when out of energy, wait another frame to play "out of time" sound } element = laser.dest_element;