From edf949bd9c91c30adbc7a0e908032b6cb5a57bc6 Mon Sep 17 00:00:00 2001 From: Misa Date: Sun, 5 Sep 2021 16:59:05 -0700 Subject: [PATCH] Use `resumegamemode` to track menu animation This fixes a bug where the player could bring up the map on the very first frame of a gamemode(game) animation. This is because the menu animation checked graphics.menuoffset, but graphics.menuoffset wouldn't have changed at that point because it only set graphics.resumegamemode. Instead, just check for graphics.resumegamemode directly. We also need to assign it to false whenever the map is closed so the player won't be prevented from using the map screen again. --- desktop_version/src/Game.cpp | 4 +--- desktop_version/src/RenderFixed.cpp | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index 2ad3d694..a506c4a8 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -6863,9 +6863,7 @@ void Game::unlockAchievement(const char *name) { void Game::mapmenuchange(const int newgamestate, const bool user_initiated) { - if (user_initiated - && graphics.menuoffset > 0 - && graphics.menuoffset < 240) + if (user_initiated && graphics.resumegamemode) { return; } diff --git a/desktop_version/src/RenderFixed.cpp b/desktop_version/src/RenderFixed.cpp index 8966724e..c8ee3809 100644 --- a/desktop_version/src/RenderFixed.cpp +++ b/desktop_version/src/RenderFixed.cpp @@ -213,6 +213,7 @@ void maprenderfixed(void) //go back to gamemode! game.mapheld = true; game.gamestate = GAMEMODE; + graphics.resumegamemode = false; } } else