X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame.c;h=c5d941dd093b0882faf8d9b2dbd16c1e7ea23f86;hb=c118d37bf6ad02e90d4ea7c4a4d7d34d8f745c26;hp=ae65ccd9bae2cf8bc6516ae4767282fb60cd2c14;hpb=a1206b26bfcc7ec67b23cb91171ef20811a2a886;p=rocksndiamonds.git diff --git a/src/game.c b/src/game.c index ae65ccd9..c5d941dd 100644 --- a/src/game.c +++ b/src/game.c @@ -15678,7 +15678,7 @@ static char *getRestartGameMessage(void) return message; } -void CheckGameOver(void) +boolean CheckRestartGame(void) { static boolean last_game_over = FALSE; static int game_over_delay = 0; @@ -15690,7 +15690,7 @@ void CheckGameOver(void) last_game_over = FALSE; game_over_delay = game_over_delay_value; - return; + return FALSE; } if (game_over_delay > 0) @@ -15700,25 +15700,34 @@ void CheckGameOver(void) game_over_delay--; - return; + return FALSE; } // do not handle game over if request dialog is already active if (game.request_active) - return; + return FALSE; // do not ask to play again if game was never actually played if (!game.GamePlayed) - return; + return FALSE; // do not ask to play again if this was disabled in setup menu if (!setup.ask_on_game_over) - return; + return FALSE; if (last_game_over != game_over) game.restart_game_message = getRestartGameMessage(); last_game_over = game_over; + + if (game.restart_game_message != NULL) + { + RequestRestartGame(game.restart_game_message); + + return TRUE; + } + + return FALSE; } boolean checkGameSolved(void)