From 5a0dc4297f602062681718fae559e0424e176af6 Mon Sep 17 00:00:00 2001 From: drfrag Date: Wed, 28 Jul 2021 14:39:47 +0200 Subject: [PATCH] - Extend the changemap command to allow warping to next or nextsecret. --- src/console/c_cmds.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/console/c_cmds.cpp b/src/console/c_cmds.cpp index 5970f2fd46..9da63779a3 100644 --- a/src/console/c_cmds.cpp +++ b/src/console/c_cmds.cpp @@ -363,6 +363,24 @@ CCMD (changemap) const char *mapname = argv[1]; if (!strcmp(mapname, "*")) mapname = primaryLevel->MapName.GetChars(); + if (strstr(mapname, "next") && !P_CheckMapData(mapname)) + { + if (!strcmp(mapname, "next")) + { + if (primaryLevel->NextMap.Len() > 0 && primaryLevel->NextMap.Compare("enDSeQ", 6)) + { + mapname = primaryLevel->NextMap.GetChars(); + } + } + else if (!strcmp(mapname, "nextsecret")) + { + if (primaryLevel->NextSecretMap.Len() > 0 && primaryLevel->NextSecretMap.Compare("enDSeQ", 6)) + { + mapname = primaryLevel->NextSecretMap.GetChars(); + } + } + } + try { if (!P_CheckMapData(mapname))