From 119d2ad25f73f305eb6a85fa5c7e710eb47a3a87 Mon Sep 17 00:00:00 2001 From: Misa Date: Wed, 15 Apr 2020 12:11:33 -0700 Subject: [PATCH] Condense indentation levels of else-if chain in "play" menu Previously, the code looked something like: else { if (...) {...} else { if (...) {...} else { etc. } } And kept indenting every time there was an else-if. This commit puts all else-ifs on the same indentation level, so it doesn't slowly push the code to the right. --- desktop_version/src/Game.cpp | 63 ++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 36 deletions(-) diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index 4d877048..21c5487e 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -6923,44 +6923,35 @@ void Game::createmenu( std::string t ) createmenu("unlocknodeathmode"); savemystats = true; } + //Alright then! Flip mode? + else if (unlock[5] && !unlocknotify[18]) + { + unlock[18] = true; + unlocknotify[18] = true; + createmenu("unlockflipmode"); + savemystats = true; + } + //What about the intermission levels? + else if (unlock[7] && !unlocknotify[16]) + { + unlock[16] = true; + unlocknotify[16] = true; + createmenu("unlockintermission"); + savemystats = true; + } + //ok, secret lab! no notification, but test: + else if (unlock[8]) + { + createmenu("playsecretlab"); + } else { - //Alright then! Flip mode? - if (unlock[5] && !unlocknotify[18]) - { - unlock[18] = true; - unlocknotify[18] = true; - createmenu("unlockflipmode"); - savemystats = true; - } - else - { - //What about the intermission levels? - if (unlock[7] && !unlocknotify[16]) - { - unlock[16] = true; - unlocknotify[16] = true; - createmenu("unlockintermission"); - savemystats = true; - } - else - { - //ok, secret lab! no notification, but test: - if (unlock[8]) - { - createmenu("playsecretlab"); - } - else - { - option("continue"); - option("play modes"); - option("new game"); - option("return"); - menuxoff = -20; - menuyoff = -40; - } - } - } + option("continue"); + option("play modes"); + option("new game"); + option("return"); + menuxoff = -20; + menuyoff = -40; } } }