- open the in-game menu only when really inside a game and actually playing.

Fixes #182
This isn't foolproof but it's probably the best that can be done.
This commit is contained in:
Christoph Oelckers 2020-08-14 22:41:32 +02:00
parent 2403e8cb2c
commit ff38cfe179
2 changed files with 3 additions and 15 deletions

View file

@ -1084,14 +1084,7 @@ CCMD(reset2saved)
CCMD(menu_main) CCMD(menu_main)
{ {
M_StartControlPanel(true); M_StartControlPanel(true);
M_SetMenu(NAME_Mainmenu, -1); M_SetMenu(gi->CanSave() ? NAME_IngameMenu : NAME_Mainmenu, -1);
}
CCMD(openmainmenu)
{
//gi->ClearSoundLocks();
M_StartControlPanel(true);
M_SetMenu(NAME_IngameMenu);
} }
CCMD(openhelpmenu) CCMD(openhelpmenu)

View file

@ -269,15 +269,10 @@ void GameInterface::MenuClosed()
bool GameInterface::CanSave() bool GameInterface::CanSave()
{ {
if (ud.recstat == 2) return false; if (ud.recstat == 2 || gamestate != GS_LEVEL) return false;
auto &myplayer = ps[myconnectindex]; auto &myplayer = ps[myconnectindex];
if (sprite[myplayer.i].extra <= 0) return (sprite[myplayer.i].extra > 0);
{
//P_DoQuote(QUOTE_SAVE_DEAD, &myplayer); // handled by the menu.
return false;
} }
return true;
}
void GameInterface::StartGame(FNewGameStartup& gs) void GameInterface::StartGame(FNewGameStartup& gs)
{ {