diff --git a/src/d_main.cpp b/src/d_main.cpp index 925d2c852..15d5729c9 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -1506,8 +1506,7 @@ void D_SRB2Main(void) // conversion sometimes needs the palette V_ReloadPalette(); - P_InitMapData(); - basenummapheaders = nummapheaders; + P_InitMapData(false); CON_SetLoadingProgress(LOADED_IWAD); @@ -1566,7 +1565,7 @@ void D_SRB2Main(void) // // search for pwad maps // - P_InitMapData(); + P_InitMapData(true); HU_LoadGraphics(); } diff --git a/src/doomstat.h b/src/doomstat.h index 8eaf86de1..12739ce25 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -449,7 +449,7 @@ struct mapheader_t #define LF2_VISITNEEDED (1<<3) ///< Not available in Time Attack modes until you visit the level extern mapheader_t** mapheaderinfo; -extern INT32 nummapheaders, basenummapheaders, mapallocsize; +extern INT32 nummapheaders, mapallocsize; #define MAXMAPLUMPNAME 64 // includes \0, for cleaner savedata diff --git a/src/g_game.c b/src/g_game.c index 030350d1f..dd4176fd5 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -184,7 +184,6 @@ struct quake quake; // Map Header Information mapheader_t** mapheaderinfo = {NULL}; INT32 nummapheaders, mapallocsize = 0; -INT32 basenummapheaders = 0; // Kart cup definitions cupheader_t *kartcupheaders = NULL; diff --git a/src/p_setup.c b/src/p_setup.c index dd7132ba7..43425c35a 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -8674,7 +8674,7 @@ lumpnum_t wadnamelump = LUMPERROR; INT16 wadnamemap = 0; // gamemap based // Initialising map data... -UINT8 P_InitMapData(void) +UINT8 P_InitMapData(boolean existingmapheaders) { UINT8 ret = 0; INT32 i; @@ -8691,7 +8691,15 @@ UINT8 P_InitMapData(void) // Doesn't exist? if (maplump == INT16_MAX) + { +#ifndef DEVELOP + if (!existingmapheaders) + { + I_Error("P_InitMapData: Base map %s has a header but no level\n", name); + } +#endif continue; + } // No change? if (mapheaderinfo[i]->lumpnum == maplump) @@ -8701,7 +8709,7 @@ UINT8 P_InitMapData(void) { ret |= MAPRET_ADDED; - if (basenummapheaders) + if (existingmapheaders) { CONS_Printf("%s\n", name); @@ -8714,6 +8722,7 @@ UINT8 P_InitMapData(void) ret |= MAPRET_CURRENTREPLACED; } } + mapheaderinfo[i]->lumpnum = maplump; if (maplump == wadnamelump) wadnamemap = i+1; @@ -9008,7 +9017,7 @@ boolean P_MultiSetupWadFiles(boolean fullsetup) if (partadd_stage == 2) { - UINT8 mapsadded = P_InitMapData(); + UINT8 mapsadded = P_InitMapData(true); if (!mapsadded) CONS_Printf(M_GetText("No maps added\n")); diff --git a/src/p_setup.h b/src/p_setup.h index e4d33d9c0..70b93d532 100644 --- a/src/p_setup.h +++ b/src/p_setup.h @@ -113,7 +113,7 @@ boolean P_AddWadFile(const char *wadfilename, wadcompat_t compat); #define MAPRET_ADDED (1) #define MAPRET_CURRENTREPLACED (1<<1) -UINT8 P_InitMapData(void); +UINT8 P_InitMapData(boolean existingmapheaders); extern lumpnum_t wadnamelump; extern INT16 wadnamemap; #define WADNAMECHECK(name) (!strncmp(name, "WADNAME", 7))