diff --git a/src/d_netfil.c b/src/d_netfil.c index 5b02d539a..d34fc4d83 100644 --- a/src/d_netfil.c +++ b/src/d_netfil.c @@ -167,7 +167,7 @@ UINT8 *PutFileNeeded(UINT16 firstfile) for (; i < numwadfiles; i++) //mainwads+1, otherwise we start on the first mainwad { // If it has only music/sound lumps, don't put it in the list - if (!wadfiles[i]->important) + if (!wadfiles[i]->important || wadfiles[i]->localfile) continue; if (firstfile) @@ -563,7 +563,7 @@ INT32 CL_CheckFiles(void) // CONS_Printf("checking %d of %d / %d of %d?\n", i, fileneedednum, j, numwadfiles); // CONS_Printf("i: %s / j: %s \n", fileneeded[i].filename, wadfiles[j]->filename); - if (j < numwadfiles && !wadfiles[j]->important && !wadfiles[j]->localfile) + if (j < numwadfiles && (!wadfiles[j]->important || wadfiles[j]->localfile)) { // Unimportant on our side. ++j; diff --git a/src/p_setup.c b/src/p_setup.c index 4739b87f7..8503349f1 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -9513,7 +9513,7 @@ UINT16 P_PartialAddWadFile(const char *wadfilename, wadcompat_t compat, boolean // UINT16 mapPos, mapNum = 0; // Init file. - if ((numlumps = W_InitFile(wadfilename, false, false, compat)) == INT16_MAX) + if ((numlumps = W_InitFile(wadfilename, false, false, local, compat)) == INT16_MAX) { refreshdirmenu |= REFRESHDIR_NOTLOADED; return UINT16_MAX; @@ -9526,8 +9526,6 @@ UINT16 P_PartialAddWadFile(const char *wadfilename, wadcompat_t compat, boolean partadd_important = true; } - wadfiles[wadnum]->localfile = local; - if (partadd_stage != 0) { partadd_earliestfile = wadnum; diff --git a/src/w_wad.c b/src/w_wad.c index 8420333d1..74b717ba8 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -869,7 +869,7 @@ static UINT16 W_InitFileError (const char *filename, boolean exitworthy) // // Can now load dehacked files (.soc) // -UINT16 W_InitFile(const char *filename, boolean mainfile, boolean startup, wadcompat_t compat) +UINT16 W_InitFile(const char *filename, boolean mainfile, boolean startup, boolean local, wadcompat_t compat) { FILE *handle; lumpinfo_t *lumpinfo = NULL; @@ -981,6 +981,7 @@ UINT16 W_InitFile(const char *filename, boolean mainfile, boolean startup, wadco fseek(handle, 0, SEEK_END); wadfile->filesize = (unsigned)ftell(handle); wadfile->type = type; + wadfile->localfile = local; // already generated, just copy it over wadfile->hash = filehash; @@ -1076,7 +1077,7 @@ INT32 W_InitMultipleFiles(char **filenames, boolean addons) G_SetGameModified(true, false); //CONS_Debug(DBG_SETUP, "Loading %s\n", *filenames); - rc = W_InitFile(*filenames, !addons, true, WC_AUTO); + rc = W_InitFile(*filenames, !addons, true, false, WC_AUTO); if (rc == INT16_MAX) CONS_Printf(M_GetText("Errors occurred while loading %s; not added.\n"), *filenames); overallrc &= (rc != INT16_MAX) ? 1 : 0; diff --git a/src/w_wad.h b/src/w_wad.h index 2bde404bf..d654185f1 100644 --- a/src/w_wad.h +++ b/src/w_wad.h @@ -154,7 +154,7 @@ void W_Shutdown(void); // Opens a WAD file. Returns the FILE * handle for the file, or NULL if not found or could not be opened FILE *W_OpenWadFile(const char **filename, boolean useerrors); // Load and add a wadfile to the active wad files, returns numbers of lumps, INT16_MAX on error -UINT16 W_InitFile(const char *filename, boolean mainfile, boolean startup, wadcompat_t compat); +UINT16 W_InitFile(const char *filename, boolean mainfile, boolean startup, boolean local, wadcompat_t compat); boolean W_MakeFileHash(const char *filename, boolean openwad, UINT64 *ret);