mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03:00
Fix cycling title BG more than once per frame
This can happen if you select an option in a menu that (A) returns to the previous menu and (B) saves settings. If the settings save fails, this will create another menu on the same frame that cycles the tower BG after it's already been cycled for that frame. Examples are the slowdown and glitchrunner menus. I could fix this by creating a new function that copy-pastes all of Game::savestatsandsettings_menu() except for the map.nexttowercolour() at the end. But that's copy-pasting code. Instead what I've done is added a variable to signal if the color has already been cycled this frame, so we don't cycle it again. This also covers cases of possible double-cycling in the future as well.
This commit is contained in:
@@ -724,7 +724,7 @@ static void unfocused_run(void)
|
||||
|
||||
static void focused_begin(void)
|
||||
{
|
||||
/* no-op. */
|
||||
map.nexttowercolour_set = false;
|
||||
}
|
||||
|
||||
static void focused_end(void)
|
||||
|
||||
Reference in New Issue
Block a user