diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index 1f0fd817..d2fdddaf 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -1357,7 +1357,7 @@ void Game::updatestate() { returntomenu(Menu::levellist); } - else if (telesummary != "" || quicksummary != "" || anything_unlocked()) + else if (save_exists() || anything_unlocked()) { returntomenu(Menu::play); } @@ -7031,7 +7031,7 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ ) } else { - if (telesummary != "" || quicksummary != "") + if (save_exists()) { option("continue"); } @@ -7045,7 +7045,7 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ ) option("secret lab", !map.invincibility && slowdown == 30); } option("play modes"); - if (telesummary != "" || quicksummary != "") + if (save_exists()) { option("new game"); } @@ -7346,3 +7346,8 @@ bool Game::anything_unlocked() } return false; } + +bool Game::save_exists() +{ + return telesummary != "" || quicksummary != ""; +} diff --git a/desktop_version/src/Game.h b/desktop_version/src/Game.h index aa98fe16..d48b70cb 100644 --- a/desktop_version/src/Game.h +++ b/desktop_version/src/Game.h @@ -328,6 +328,7 @@ public: std::string activity_lastprompt; std::string telesummary, quicksummary, customquicksummary; + bool save_exists(); bool backgroundtext; diff --git a/desktop_version/src/Input.cpp b/desktop_version/src/Input.cpp index b003ceb4..d14cde31 100644 --- a/desktop_version/src/Input.cpp +++ b/desktop_version/src/Input.cpp @@ -134,7 +134,7 @@ void menuactionpress() #if !defined(MAKEANDPLAY) case 0: //Play - if (game.telesummary == "" && game.quicksummary == "" && !game.anything_unlocked()) + if (!game.save_exists() && !game.anything_unlocked()) { //No saves exist, just start a new game game.mainmenu = 0; @@ -950,12 +950,12 @@ void menuactionpress() //Do we have the Secret Lab option? int sloffset = game.unlock[8] ? 0 : -1; //Do we have a telesave or quicksave? - int ngoffset = game.telesummary != "" || game.quicksummary != "" ? 0 : -1; + int ngoffset = game.save_exists() ? 0 : -1; if (game.currentmenuoption == 0) { //continue //right, this depends on what saves you've got - if (game.telesummary == "" && game.quicksummary == "") + if (!game.save_exists()) { //You have no saves but have something unlocked, or you couldn't have gotten here game.mainmenu = 0; @@ -998,7 +998,7 @@ void menuactionpress() game.createmenu(Menu::playmodes); map.nexttowercolour(); } - else if (game.currentmenuoption == sloffset+3 && (game.telesummary != "" || game.quicksummary != "")) + else if (game.currentmenuoption == sloffset+3 && game.save_exists()) { //newgame music.playef(11);