From 757e20ae24f1baf580d01b2d85a8ebe008f5fcdd Mon Sep 17 00:00:00 2001 From: NyakoFox Date: Tue, 4 Jun 2024 11:07:45 -0300 Subject: [PATCH] Fix saveless saving and quitting hiding buttons Basically, when you save and quit, if you have a save, it attempts to return to the `play` menu. Unfortunately for us, if you don't have a save first, that menu never existed. You went directly from `mainmenu` to the gameplay state. Since `play` never existed, the code didn't have any menu to return to, so no buttons got created. My fix is simple: if the menu isn't found, just make it. --- desktop_version/src/Game.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index 9e5b1da3..c2749c2f 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -6578,11 +6578,14 @@ void Game::returntomenu(enum Menu::MenuName t) if (is_the_menu_we_want) { - break; + return; } i--; } + + // If we didn't find the menu we wanted, just go to the menu we wanted + createmenu(t); } void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )