Only load map lumps that are WADs or have no extension

# Conflicts:
#	src/w_wad.c
This commit is contained in:
toaster 2022-03-18 20:30:02 +00:00
parent 2a92a80e7a
commit 5783c5aace
2 changed files with 6 additions and 2 deletions

View file

@ -4313,7 +4313,7 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate)
// internal game map
maplumpname = G_BuildMapName(gamemap);
lastloadedmaplumpnum = W_CheckNumForName(maplumpname);
lastloadedmaplumpnum = W_CheckNumForMap(maplumpname);
if (lastloadedmaplumpnum == LUMPERROR)
I_Error("Map %s not found.\n", maplumpname);

View file

@ -1229,7 +1229,11 @@ lumpnum_t W_CheckNumForMap(const char *name)
{
p = wadfiles[i]->lumpinfo + lumpNum;
if (p->hash == hash && !strnicmp(name, p->name, 8))
return (i<<16) + lumpNum;
{
const char *extension = strrchr(p->fullname, '.');
if (!(extension && stricmp(extension, ".wad")))
return (i<<16) + lumpNum;
}
}
}
}