Move modified check on -file addons later in startup

This commit is contained in:
fickleheart 2019-03-10 19:44:31 -05:00
parent fae8833ff4
commit 66c9d9aa83
3 changed files with 7 additions and 8 deletions

View File

@ -1164,11 +1164,7 @@ void D_SRB2Main(void)
const char *s = M_GetNextParm(); const char *s = M_GetNextParm();
if (s) // Check for NULL? if (s) // Check for NULL?
{
if (!W_VerifyNMUSlumps(s))
G_SetGameModified(true, false);
D_AddFile(s, startuppwads); D_AddFile(s, startuppwads);
}
} }
} }
} }
@ -1218,7 +1214,7 @@ void D_SRB2Main(void)
// load wad, including the main wad file // load wad, including the main wad file
CONS_Printf("W_InitMultipleFiles(): Adding IWAD and main PWADs.\n"); CONS_Printf("W_InitMultipleFiles(): Adding IWAD and main PWADs.\n");
if (!W_InitMultipleFiles(startupwadfiles)) if (!W_InitMultipleFiles(startupwadfiles, false))
#ifdef _DEBUG #ifdef _DEBUG
CONS_Error("A WAD file was not found or not valid.\nCheck the log to see which ones.\n"); CONS_Error("A WAD file was not found or not valid.\nCheck the log to see which ones.\n");
#else #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"); CONS_Error("A PWAD file was not found or not valid.\nCheck the log to see which ones.\n");
D_CleanFile(startuppwads); D_CleanFile(startuppwads);

View File

@ -855,13 +855,16 @@ void W_UnloadWadFile(UINT16 num)
* \return 1 if all files were loaded, 0 if at least one was missing or * \return 1 if all files were loaded, 0 if at least one was missing or
* invalid. * invalid.
*/ */
INT32 W_InitMultipleFiles(char **filenames) INT32 W_InitMultipleFiles(char **filenames, boolean addons)
{ {
INT32 rc = 1; INT32 rc = 1;
// will be realloced as lumps are added // will be realloced as lumps are added
for (; *filenames; filenames++) for (; *filenames; filenames++)
{ {
if (addons && !W_VerifyNMUSlumps(*filenames))
G_SetGameModified(true, false);
//CONS_Debug(DBG_SETUP, "Loading %s\n", *filenames); //CONS_Debug(DBG_SETUP, "Loading %s\n", *filenames);
rc &= (W_InitFile(*filenames) != INT16_MAX) ? 1 : 0; rc &= (W_InitFile(*filenames) != INT16_MAX) ? 1 : 0;
} }

View File

@ -133,7 +133,7 @@ void W_UnloadWadFile(UINT16 num);
// W_InitMultipleFiles returns 1 if all is okay, 0 otherwise, // 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. // 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_CheckNameForNumPwad(UINT16 wad, UINT16 lump);
const char *W_CheckNameForNum(lumpnum_t lumpnum); const char *W_CheckNameForNum(lumpnum_t lumpnum);