- add RedirectCVAR directive for loading alternate maps based on a Bool CVAR setting

This commit is contained in:
Rachael Alexanderson 2023-01-30 16:45:03 -05:00 committed by Rachael Alexanderson
commit 04ea28defc
3 changed files with 43 additions and 0 deletions

View file

@ -557,6 +557,12 @@ void G_InitNew (const char *mapname, bool bTitleLevel)
// [RH] Mark all levels as not visited
for (unsigned int i = 0; i < wadlevelinfos.Size(); i++)
wadlevelinfos[i].flags = wadlevelinfos[i].flags & ~LEVEL_VISITED;
auto redirectmap = FindLevelInfo(mapname);
if (redirectmap->RedirectCVAR != NAME_None)
redirectmap = redirectmap->CheckLevelRedirect();
if (redirectmap)
mapname = redirectmap->MapName;
}
UnlatchCVars ();