- use stricter checks when trying to levelwarp.

If saving is blocked, so should changing the level.
Fixes #204.
This commit is contained in:
Christoph Oelckers 2020-11-29 15:22:54 +01:00
parent 92bf1232da
commit cd1b79a703
2 changed files with 3 additions and 3 deletions

View file

@ -304,7 +304,7 @@ static MapRecord* levelwarp_common(FCommandLine& argv, const char *cmdname, cons
CCMD(levelwarp)
{
if (gamestate != GS_LEVEL)
if (!gi->CanSave())
{
Printf("Use the startgame command when not in a game.\n");
return;
@ -359,7 +359,7 @@ CCMD(changemap)
Printf(PRINT_BOLD, "changemap <mapname>: warp to the given map, identified by its name.\n");
return;
}
if (gamestate != GS_LEVEL)
if (!gi->CanSave())
{
Printf("Use the map command when not in a game.\n");
return;

View file

@ -632,7 +632,7 @@ void EraseScreen(int nVal)
bool GameInterface::CanSave()
{
return !bRecord && !bPlayback && !paused && !bInDemo && nTotalPlayers == 1;
return gamestate == GS_LEVEL && !bRecord && !bPlayback && !paused && !bInDemo && nTotalPlayers == 1;
}
::GameStats GameInterface::getStats()