Merge branch 'file-and-header-fix' into 'master'

File and header fix (resolves #370)

Closes #370

See merge request KartKrew/Kart!848
This commit is contained in:
Sal 2023-01-03 00:40:38 +00:00
commit cab15b7d07
3 changed files with 4 additions and 4 deletions

View file

@ -7771,7 +7771,7 @@ UINT8 P_InitMapData(boolean existingmapheaders)
for (i = 0; i < nummapheaders; ++i)
{
name = mapheaderinfo[i]->lumpname;
maplump = W_CheckNumForMap(name);
maplump = W_CheckNumForMap(name, (mapheaderinfo[i]->lumpnum == LUMPERROR));
// Always check for cup cache reassociations.
// (The core assumption is that cups < headers.)

View file

@ -1309,12 +1309,12 @@ lumpnum_t W_CheckNumForLongName(const char *name)
// Look for valid map data through all added files in descendant order.
// Get a map marker for WADs, and a standalone WAD file lump inside PK3s.
lumpnum_t W_CheckNumForMap(const char *name)
lumpnum_t W_CheckNumForMap(const char *name, boolean checktofirst)
{
lumpnum_t check = INT16_MAX;
UINT32 uhash, hash = quickncasehash(name, LUMPNUMCACHENAME);
INT32 i;
UINT16 firstfile = (partadd_earliestfile == UINT16_MAX) ? 0 : partadd_earliestfile;
UINT16 firstfile = (checktofirst || (partadd_earliestfile == UINT16_MAX)) ? 0 : partadd_earliestfile;
// Check the lumpnumcache first. Loop backwards so that we check
// most recent entries first

View file

@ -171,7 +171,7 @@ UINT16 W_CheckNumForFullNamePK3(const char *name, UINT16 wad, UINT16 startlump);
UINT16 W_CheckNumForFolderStartPK3(const char *name, UINT16 wad, UINT16 startlump);
UINT16 W_CheckNumForFolderEndPK3(const char *name, UINT16 wad, UINT16 startlump);
lumpnum_t W_CheckNumForMap(const char *name);
lumpnum_t W_CheckNumForMap(const char *name, boolean checktofirst);
lumpnum_t W_CheckNumForName(const char *name);
lumpnum_t W_CheckNumForLongName(const char *name);
lumpnum_t W_GetNumForName(const char *name); // like W_CheckNumForName but I_Error on LUMPERROR