X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame.c;h=ec86a61f86edcfde7e1b1fbe15decc49a91f41b1;hb=3c872da037d149c95f17614cb231d5bfbc1e5cc4;hp=2c16aa62c93d95c8a5344eb9f5d44aea92955c54;hpb=68bef97fc43a47111a2f4fc6d28c43c3540eea96;p=rocksndiamonds.git diff --git a/src/game.c b/src/game.c index 2c16aa62..ec86a61f 100644 --- a/src/game.c +++ b/src/game.c @@ -4621,6 +4621,7 @@ void InitGame(void) game.restart_level = FALSE; game.request_active = FALSE; game.envelope_active = FALSE; + game.any_door_active = FALSE; if (level.game_engine_type == GAME_ENGINE_TYPE_MM) InitGameActions_MM(); @@ -5164,6 +5165,10 @@ void GameEnd(void) // Important note: This function is not only called after "GameWon()", but also after // "game over" (if automatically asking for restarting the game is disabled in setup) + // do not handle game end if request dialog is already active + if (checkRequestActive()) + return; + if (game.LevelSolved) game.LevelSolved_GameEnd = TRUE; @@ -16342,7 +16347,7 @@ boolean CheckRestartGame(void) } // do not ask to play again if request dialog is already active - if (game.request_active) + if (checkRequestActive()) return FALSE; // do not ask to play again if request dialog already handled @@ -16411,6 +16416,11 @@ boolean checkGameEnded(void) return (checkGameSolved() || checkGameFailed()); } +boolean checkRequestActive(void) +{ + return (game.request_active || game.envelope_active || game.any_door_active); +} + // ---------------------------------------------------------------------------- // random generator functions