diff --git a/src/console/c_cmds.cpp b/src/console/c_cmds.cpp index 5970f2fd4..9da63779a 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))