From: Holger Schemel Date: Mon, 19 Dec 2016 20:57:34 +0000 (+0100) Subject: added storing last game mode when setting new game mode X-Git-Tag: 4.0.0.0~3 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=1f295bbb8d7a54989dd60a4f3aee7b4ca5719bf1;p=rocksndiamonds.git added storing last game mode when setting new game mode --- 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);