From 66c9d9aa838b1b80dbceedc3b2b43c520112ad15 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sun, 10 Mar 2019 19:44:31 -0500 Subject: [PATCH] Move modified check on -file addons later in startup --- src/d_main.c | 8 ++------ src/w_wad.c | 5 ++++- src/w_wad.h | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 31320267..ba67eee9 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1164,11 +1164,7 @@ void D_SRB2Main(void) const char *s = M_GetNextParm(); if (s) // Check for NULL? - { - if (!W_VerifyNMUSlumps(s)) - G_SetGameModified(true, false); D_AddFile(s, startuppwads); - } } } } @@ -1218,7 +1214,7 @@ void D_SRB2Main(void) // load wad, including the main wad file CONS_Printf("W_InitMultipleFiles(): Adding IWAD and main PWADs.\n"); - if (!W_InitMultipleFiles(startupwadfiles)) + if (!W_InitMultipleFiles(startupwadfiles, false)) #ifdef _DEBUG CONS_Error("A WAD file was not found or not valid.\nCheck the log to see which ones.\n"); #else @@ -1284,7 +1280,7 @@ void D_SRB2Main(void) } } - if (!W_InitMultipleFiles(startuppwads)) + if (!W_InitMultipleFiles(startuppwads, true)) CONS_Error("A PWAD file was not found or not valid.\nCheck the log to see which ones.\n"); D_CleanFile(startuppwads); diff --git a/src/w_wad.c b/src/w_wad.c index 5ae67aa8..15e4177e 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -855,13 +855,16 @@ void W_UnloadWadFile(UINT16 num) * \return 1 if all files were loaded, 0 if at least one was missing or * invalid. */ -INT32 W_InitMultipleFiles(char **filenames) +INT32 W_InitMultipleFiles(char **filenames, boolean addons) { INT32 rc = 1; // will be realloced as lumps are added for (; *filenames; filenames++) { + if (addons && !W_VerifyNMUSlumps(*filenames)) + G_SetGameModified(true, false); + //CONS_Debug(DBG_SETUP, "Loading %s\n", *filenames); rc &= (W_InitFile(*filenames) != INT16_MAX) ? 1 : 0; } diff --git a/src/w_wad.h b/src/w_wad.h index e2e17740..762d3708 100644 --- a/src/w_wad.h +++ b/src/w_wad.h @@ -133,7 +133,7 @@ void W_UnloadWadFile(UINT16 num); // W_InitMultipleFiles returns 1 if all is okay, 0 otherwise, // so that it stops with a message if a file was not found, but not if all is okay. -INT32 W_InitMultipleFiles(char **filenames); +INT32 W_InitMultipleFiles(char **filenames, boolean addons); const char *W_CheckNameForNumPwad(UINT16 wad, UINT16 lump); const char *W_CheckNameForNum(lumpnum_t lumpnum);