- Extend the changemap command to allow warping to next or nextsecret.

This commit is contained in:
drfrag 2021-07-28 14:39:47 +02:00 committed by Rachael Alexanderson
parent 7a3d8bd0e5
commit 5a0dc4297f

View file

@ -363,6 +363,24 @@ CCMD (changemap)
const char *mapname = argv[1]; const char *mapname = argv[1];
if (!strcmp(mapname, "*")) mapname = primaryLevel->MapName.GetChars(); 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 try
{ {
if (!P_CheckMapData(mapname)) if (!P_CheckMapData(mapname))