diff --git a/src/g_level.cpp b/src/g_level.cpp index 6e4cd6f4ab..1b0bd11300 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -570,18 +570,24 @@ void G_ChangeLevel(const char *levelname, int position, bool keepFacing, int nex return; } - nextlevel = levelname; - - if (strncmp(levelname, "enDSeQ", 6)) + if (strncmp(levelname, "enDSeQ", 6) != 0) { - nextinfo = FindLevelInfo (nextlevel)->CheckLevelRedirect (); - if (nextinfo) + nextinfo = FindLevelInfo (nextlevel); + if (nextinfo != NULL) { - nextlevel = nextinfo->mapname; + level_info_t *nextredir = nextinfo->CheckLevelRedirect(); + if (nextredir != NULL) + { + nextinfo = nextredir; + levelname = nextinfo->mapname; + } } } - if (nextSkill != -1) NextSkill = nextSkill; + nextlevel = levelname; + + if (nextSkill != -1) + NextSkill = nextSkill; g_nomonsters = nomonsters; diff --git a/src/g_mapinfo.cpp b/src/g_mapinfo.cpp index 800fa8957a..f85b089604 100644 --- a/src/g_mapinfo.cpp +++ b/src/g_mapinfo.cpp @@ -85,7 +85,9 @@ level_info_t *FindLevelInfo (const char *mapname) int i; if ((i = FindWadLevelInfo (mapname)) > -1) + { return &wadlevelinfos[i]; + } else { if (TheDefaultLevelInfo.LevelName.IsEmpty())