From cd1b79a703beb3ffff7573ea93f889252944cb59 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 29 Nov 2020 15:22:54 +0100 Subject: [PATCH] - use stricter checks when trying to levelwarp. If saving is blocked, so should changing the level. Fixes #204. --- source/core/cheats.cpp | 4 ++-- source/exhumed/src/exhumed.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/core/cheats.cpp b/source/core/cheats.cpp index a27a4fa3b..d8695173a 100644 --- a/source/core/cheats.cpp +++ b/source/core/cheats.cpp @@ -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 : 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; diff --git a/source/exhumed/src/exhumed.cpp b/source/exhumed/src/exhumed.cpp index 918e7ef27..5798dc737 100644 --- a/source/exhumed/src/exhumed.cpp +++ b/source/exhumed/src/exhumed.cpp @@ -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()