Improve quit-to-menu menu handling

This stabilizes the code that handles the menu that you land on if you
press Esc and quit to the menu.

Instead of using Game::returnmenu(), we now use the new function
Game::returntomenu() to clearly express intent that we want to return to
a specific menu. So I've added another kludge variable
Game::wasinintermission for the was-in-intermission case.

Also, I made it so that if you didn't have a main game telesave or
quicksave, you just get brought back to the main menu. Because you
shouldn't be able to go to the play menu without a quicksave or
telesave.
This commit is contained in:
Misa
2020-04-25 19:21:23 -07:00
committed by Ethan Lee
parent 536184f394
commit 9fca3e111f
4 changed files with 22 additions and 6 deletions

View File

@@ -3471,10 +3471,7 @@ void editorlogic()
map.nexttowercolour();
ed.settingsmod=false;
graphics.backgrounddrawn=false;
//Do returnmenu twice because we have two menus:
//the main editor menu and the confirm save&quit menu
game.returnmenu();
game.returnmenu();
game.returntomenu(Menu::playerworlds);
}
}