From 1f295bbb8d7a54989dd60a4f3aee7b4ca5719bf1 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Mon, 19 Dec 2016 21:57:34 +0100 Subject: [PATCH] added storing last game mode when setting new game mode --- src/screens.c | 7 +++---- src/tools.c | 3 +++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/screens.c b/src/screens.c index 6ece1110..a4dca87a 100644 --- a/src/screens.c +++ b/src/screens.c @@ -1452,8 +1452,6 @@ void DrawMainMenu() if (CheckTitleScreen(levelset_has_changed)) { - game_status_last_screen = GAME_MODE_MAIN; - SetGameStatus(GAME_MODE_TITLE); DrawTitleScreen(); @@ -1602,6 +1600,9 @@ void HandleTitleScreen(int mx, int my, int dx, int dy, int button) /* switch game mode from title screen mode back to info screen mode */ SetGameStatus(GAME_MODE_INFO); + /* store that last screen was info screen, not main menu screen */ + game_status_last_screen = GAME_MODE_INFO; + DrawInfoScreen_NotAvailable("Title screen information:", "No title screen for this level set."); return; @@ -2678,8 +2679,6 @@ void DrawInfoScreen_HelpText(int element, int action, int direction, int ypos) void DrawInfoScreen_TitleScreen() { - game_status_last_screen = GAME_MODE_INFO; - SetGameStatus(GAME_MODE_TITLE); DrawTitleScreen(); diff --git a/src/tools.c b/src/tools.c index 794174c1..e99d26ce 100644 --- a/src/tools.c +++ b/src/tools.c @@ -8507,6 +8507,9 @@ void SetAnimStatus(int anim_status_new) void SetGameStatus(int game_status_new) { + if (game_status_new != game_status) + game_status_last_screen = game_status; + game_status = game_status_new; SetAnimStatus(game_status_new); -- 2.34.1