From a33c460d406d9ee9b9983e045952f95dbd2fe8de Mon Sep 17 00:00:00 2001 From: Misa Date: Mon, 18 May 2020 15:19:56 -0700 Subject: [PATCH] Re-create menu if returntomenu() is given current menu This fixes a bug where if you had the play menu in a state where the first option was "new game", then kept playing up until a quicksave or telesave was created, then quit to the menu, the menu wouldn't update. Thanks to KSSBrawl for reporting this bug to me: https://cdn.discordapp.com/attachments/708567577978470410/712060797924147240/untitled.webm --- desktop_version/src/Game.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index 841f91a6..124c201e 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -6583,7 +6583,13 @@ void Game::returntomenu(enum Menu::MenuName t) { if (currentmenuname == t) { - //Why are you calling this function then? + //Re-create the menu + int keep_menu_option = currentmenuoption; + createmenu(t, true); + if (keep_menu_option < (int) menuoptions.size()) + { + currentmenuoption = keep_menu_option; + } return; }