Skip to content

Commit

Permalink
- redirected maps need to be defined in order to redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
madame-rachelle committed Feb 4, 2023
1 parent b50d7f4 commit 4ac76d8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/g_level.cpp
Expand Up @@ -562,8 +562,8 @@ void G_InitNew (const char *mapname, bool bTitleLevel)
auto redirectmap = FindLevelInfo(mapname);
if (redirectmap->RedirectCVAR != NAME_None)
redirectmap = redirectmap->CheckLevelRedirect();
if (redirectmap)
mapname = redirectmap->MapName;
if (redirectmap && redirectmap->MapName.GetChars()[0])
mapname = redirectmap->MapName;
}

G_VerifySkill();
Expand Down
6 changes: 4 additions & 2 deletions src/gamedata/g_mapinfo.cpp
Expand Up @@ -403,12 +403,14 @@ level_info_t *level_info_t::CheckLevelRedirect ()
if (playeringame[i] && (var = GetCVar(i, RedirectCVAR.GetChars())))
{
if (var->ToInt())
return FindLevelInfo(RedirectCVARMapName);
if (P_CheckMapData(RedirectCVARMapName))
return FindLevelInfo(RedirectCVARMapName);
}
}
}
else if (var->ToInt())
return FindLevelInfo(RedirectCVARMapName);
if (P_CheckMapData(RedirectCVARMapName))
return FindLevelInfo(RedirectCVARMapName);
}
}
return NULL;
Expand Down

0 comments on commit 4ac76d8

Please sign in to comment.