From ac04281a9f787a8f5cf68ec63fdb4efa560cb348 Mon Sep 17 00:00:00 2001 From: Misa Date: Fri, 5 Mar 2021 00:42:55 -0800 Subject: [PATCH] Keep currentmenuoption if it's the same menu When recreating the same menu, there's basically no reason to reset the currently-selected menu option. (Also, no need to worry about indexing out of bounds or anything - the number gets checked while iterating over all menu options; it's never used to actually index anything. At worst there might be a 1-frame flicker as the bounds code in gameinput() kicks in, but that shouldn't happen anyways.) --- desktop_version/src/Game.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index ec11e4c8..d2b9ca82 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -6239,9 +6239,9 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ ) frame.option = currentmenuoption; frame.name = currentmenuname; menustack.push_back(frame); + currentmenuoption = 0; } - currentmenuoption = 0; currentmenuname = t; menuyoff = 0; int maxspacing = 30; // maximum value for menuspacing, can only become lower.