From: Holger Schemel Date: Wed, 11 Sep 2024 16:56:54 +0000 (+0200) Subject: fixed showing game actions after game end when request door opens/closes X-Git-Tag: 4.4.0.0-test-4~264 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=dec3a5309d292d7a474f8681fe2f9c46b649b4e7;p=rocksndiamonds.git fixed showing game actions after game end when request door opens/closes This fixes a bug in commit 90028d7d. It occurs when "ask on game over" is disabled, the player has died in a game and a key to restart the game is pressed (like "restart game", "replay & pause before end" or "quick load game"), which causes the newly started game to immediately freeze (although it can still be stopped with the "space" or "escape" key). --- diff --git a/src/game.c b/src/game.c index 92460cea..c813f823 100644 --- a/src/game.c +++ b/src/game.c @@ -3679,6 +3679,9 @@ void InitGame(void) int initial_move_dir = MV_DOWN; int i, j, x, y; + // required to prevent handling game actions when moving doors (via "checkGameEnded()") + game.InitGameRequested = TRUE; + // required here to update video display before fading (FIX THIS) DrawMaskedBorder(REDRAW_DOOR_2); @@ -4657,6 +4660,8 @@ void InitGame(void) } SetPlayfieldMouseCursorEnabled(!game.use_mouse_actions); + + game.InitGameRequested = FALSE; } void UpdateEngineValues(int actual_scroll_x, int actual_scroll_y, @@ -16451,6 +16456,10 @@ boolean checkGameFailed(void) boolean checkGameEnded(void) { + // required to prevent handling game actions when moving doors (during "InitGame()") + if (game.InitGameRequested) + return FALSE; + return (checkGameSolved() || checkGameFailed()); } diff --git a/src/game.h b/src/game.h index c5eba4f1..0a5b7c26 100644 --- a/src/game.h +++ b/src/game.h @@ -290,6 +290,7 @@ struct GameInfo int LevelSolved_CountingHealth; boolean RestartGameRequested; + boolean InitGameRequested; }; struct PlayerInfo