we have a global to check if config was loaded

This commit is contained in:
Alug committed 2025-04-23 13:22:53 +02:00
1 parent e87ca3fe1b
commit 72ea257a06
2 files changed
+5 -8

No files matched your search

+4 -2
View File
@@ -147,7 +147,7 @@ INT32 eventhead, eventtail;
boolean dedicated = false;
boolean loaded_config = false;
boolean loaded_config = false; // true once config.cfg loaded AND executed
//
// D_PostEvent
@@ -1881,7 +1881,9 @@ void D_SRB2Main(void)
savedata.lives = 0; // flag this as not-used
loaded_config = true; // so pallettechange doesent get called 500 times at startup lol
// make sure I_Quit() will write back the correct config
// (do not write back the config if it crash before)
loaded_config = true; // so palettechange doesent get called 500 times at startup lol
//------------------------------------------------ COMMAND LINE PARAMS
+1 -6
View File
@@ -443,7 +443,6 @@ char configfile[MAX_WADPATH];
// ==========================================================================
// CONFIGURATION
// ==========================================================================
static boolean gameconfig_loaded = false; // true once config.cfg loaded AND executed
/** Saves a player's config, possibly to a particular file.
*
@@ -548,10 +547,6 @@ void M_FirstLoadConfig(void)
// don't filter anymore vars and don't let this convsvar be changed
COM_BufInsertText(va("%s \"%d\"\n", cv_execversion.name, EXECVERSION));
CV_ToggleExecVersion(false);
// make sure I_Quit() will write back the correct config
// (do not write back the config if it crash before)
gameconfig_loaded = true;
}
/** Saves the game configuration.
@@ -565,7 +560,7 @@ void M_SaveConfig(const char *filename)
char backupfile[MAX_WADPATH+4];
// make sure not to write back the config until it's been correctly loaded
if (!gameconfig_loaded)
if (!loaded_config)
return;
// Create backup of the config file