mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-02-16 17:11:33 +00:00
Merge branch 'ignore-bad-map-lumps' into 'next'
Only load map lumps that are WADs or have no extension See merge request STJr/SRB2!1715
This commit is contained in:
commit
9d993a585f
2 changed files with 9 additions and 3 deletions
|
@ -4373,7 +4373,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);
|
||||
|
||||
|
|
10
src/w_wad.c
10
src/w_wad.c
|
@ -1463,8 +1463,14 @@ lumpnum_t W_CheckNumForMap(const char *name)
|
|||
continue;
|
||||
// Now look for the specified map.
|
||||
for (; lumpNum < end; lumpNum++)
|
||||
if (!strnicmp(name, (wadfiles[i]->lumpinfo + lumpNum)->name, 8))
|
||||
return (i<<16) + lumpNum;
|
||||
{
|
||||
if (!strnicmp(name, wadfiles[i]->lumpinfo[lumpNum].name, 8))
|
||||
{
|
||||
const char *extension = strrchr(wadfiles[i]->lumpinfo[lumpNum].fullname, '.');
|
||||
if (!(extension && stricmp(extension, ".wad")))
|
||||
return (i<<16) + lumpNum;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return LUMPERROR;
|
||||
|
|
Loading…
Reference in a new issue