From: Holger Schemel Date: Sat, 2 Dec 2023 11:20:26 +0000 (+0100) Subject: added showing game actions after game end when request door opens/closes X-Git-Tag: 4.3.8.0~26 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;ds=sidebyside;h=90028d7d5240bfc3b674491c615f5f2abd0ca06d;p=rocksndiamonds.git added showing game actions after game end when request door opens/closes --- diff --git a/src/game.c b/src/game.c index a2dcd13d..d1bf2d7d 100644 --- a/src/game.c +++ b/src/game.c @@ -3870,6 +3870,8 @@ void InitGame(void) game.LevelSolved_CountingScore = 0; game.LevelSolved_CountingHealth = 0; + game.RestartGameRequested = FALSE; + game.panel.active = TRUE; game.no_level_time_limit = (level.time == 0); @@ -15806,6 +15808,10 @@ boolean CheckRestartGame(void) 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; @@ -15814,6 +15820,8 @@ boolean CheckRestartGame(void) if (!setup.ask_on_game_over) return FALSE; + game.RestartGameRequested = TRUE; + RequestRestartGame(); return TRUE; diff --git a/src/game.h b/src/game.h index 8fdfbdc8..c555578b 100644 --- a/src/game.h +++ b/src/game.h @@ -275,6 +275,8 @@ struct GameInfo int LevelSolved_CountingTime; int LevelSolved_CountingScore; int LevelSolved_CountingHealth; + + boolean RestartGameRequested; }; struct PlayerInfo diff --git a/src/tools.c b/src/tools.c index 8a8924e3..b366a608 100644 --- a/src/tools.c +++ b/src/tools.c @@ -5407,6 +5407,8 @@ unsigned int MoveDoor(unsigned int door_state) 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]; @@ -5673,6 +5675,9 @@ unsigned int MoveDoor(unsigned int door_state) if (!(door_state & DOOR_NO_DELAY)) { + if (game_just_ended) + HandleGameActions(); + BackToFront(); SkipUntilDelayReached(&door_delay, &k, last_frame); @@ -5696,7 +5701,12 @@ unsigned int MoveDoor(unsigned int door_state) door_delay.value = door_2.post_delay; while (!DelayReached(&door_delay)) + { + if (game_just_ended) + HandleGameActions(); + BackToFront(); + } } }