From: Holger Schemel Date: Sat, 18 Feb 2023 12:00:49 +0000 (+0100) Subject: added forced restart of global animations when restarting game X-Git-Tag: 4.3.5.1~4 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=80b1d8bbd4ac4555c28208436fe63fbf8947d97a;p=rocksndiamonds.git added forced restart of global animations when restarting game --- diff --git a/src/game.c b/src/game.c index 68916166..197ad64d 100644 --- a/src/game.c +++ b/src/game.c @@ -3573,7 +3573,7 @@ void InitGame(void) int full_lev_fieldx = lev_fieldx + (BorderElement != EL_EMPTY ? 2 : 0); int full_lev_fieldy = lev_fieldy + (BorderElement != EL_EMPTY ? 2 : 0); int fade_mask = REDRAW_FIELD; - + boolean restarting = (game_status == GAME_MODE_PLAYING); boolean emulate_bd = TRUE; // unless non-BOULDERDASH elements found boolean emulate_sp = TRUE; // unless non-SUPAPLEX elements found int initial_move_dir = MV_DOWN; @@ -3585,7 +3585,15 @@ void InitGame(void) if (!game.restart_level) CloseDoor(DOOR_CLOSE_1); - SetGameStatus(GAME_MODE_PLAYING); + if (restarting) + { + // force fading out global animations displayed during game play + SetGameStatus(GAME_MODE_LOADING); + } + else + { + SetGameStatus(GAME_MODE_PLAYING); + } if (level_editor_test_game) FadeSkipNextFadeOut(); @@ -3601,6 +3609,14 @@ void InitGame(void) FadeOut(fade_mask); + if (restarting) + { + // force restarting global animations displayed during game play + RestartGlobalAnims(); + + SetGameStatus(GAME_MODE_PLAYING); + } + if (level_editor_test_game) FadeSkipNextFadeIn();