From cdd2329b6352452230f80126747f676707d52fa5 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 5 Sep 2020 00:00:55 +0200 Subject: [PATCH] - fixed levelwarp for games with linear level counting. Fixes #337 --- source/core/cheats.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/core/cheats.cpp b/source/core/cheats.cpp index 63f90d4d9..08ebe60ad 100644 --- a/source/core/cheats.cpp +++ b/source/core/cheats.cpp @@ -268,14 +268,14 @@ static MapRecord* levelwarp_common(FCommandLine& argv, const char *cmdname, cons return nullptr; } // Values are one-based. - int e = numparm == 2 ? atoi(argv[1]) : 0; + int e = numparm == 2 ? atoi(argv[1]) : 1; int m = atoi(numparm == 2 ? argv[2] : argv[1]); if (e <= 0 || m <= 0) { Printf(PRINT_BOLD, "Invalid level! Numbers must be > 0\n"); return nullptr; } - auto map = FindMapByLevelNum(levelnum(e - 1, m - 1)); + auto map = FindMapByLevelNum(numparm == 1 ? m : levelnum(e - 1, m - 1)); if (!map) { if (numparm == 2) Printf(PRINT_BOLD, "Level E%s L%s not found!\n", argv[1], argv[2]);