game.LevelSolved_CountingScore = 0;
game.LevelSolved_CountingHealth = 0;
+ game.RestartGameRequested = FALSE;
+
game.panel.active = TRUE;
game.no_level_time_limit = (level.time == 0);
if (game.request_active)
return FALSE;
+ // do not ask to play again if request dialog already handled
+ if (game.RestartGameRequested)
+ return FALSE;
+
// do not ask to play again if game was never actually played
if (!game.GamePlayed)
return FALSE;
if (!setup.ask_on_game_over)
return FALSE;
+ game.RestartGameRequested = TRUE;
+
RequestRestartGame();
return TRUE;
int LevelSolved_CountingTime;
int LevelSolved_CountingScore;
int LevelSolved_CountingHealth;
+
+ boolean RestartGameRequested;
};
struct PlayerInfo
if (door_state & DOOR_ACTION)
{
+ boolean game_just_ended = (game_status == GAME_MODE_PLAYING &&
+ checkGameEnded());
boolean door_panel_drawn[NUM_DOORS];
boolean panel_has_doors[NUM_DOORS];
boolean door_part_skip[MAX_DOOR_PARTS];
if (!(door_state & DOOR_NO_DELAY))
{
+ if (game_just_ended)
+ HandleGameActions();
+
BackToFront();
SkipUntilDelayReached(&door_delay, &k, last_frame);
door_delay.value = door_2.post_delay;
while (!DelayReached(&door_delay))
+ {
+ if (game_just_ended)
+ HandleGameActions();
+
BackToFront();
+ }
}
}