mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-26 14:01:05 +00:00
- Partially resolve issues loading autoexec.cfg files.
* This works for Raze's running directory, but is not pulling in autoexec.cfg files from subdirectories from Raze's running directory (Duke, Duke.Duke) or paths where game content resides (Steam, for instance). * Partially addresses #110
This commit is contained in:
parent
3582717c43
commit
a9ad043c36
2 changed files with 39 additions and 3 deletions
|
@ -503,6 +503,21 @@ CCMD (whereisini)
|
|||
FGameConfigFile* GameConfig;
|
||||
static FString GameName;
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// D_MultiExec
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
FExecList *D_MultiExec (FArgs *list, FExecList *exec)
|
||||
{
|
||||
for (int i = 0; i < list->NumArgs(); ++i)
|
||||
{
|
||||
exec = C_ParseExecFile(list->GetArg(i), exec);
|
||||
}
|
||||
return exec;
|
||||
}
|
||||
|
||||
void G_LoadConfig()
|
||||
{
|
||||
GameConfig = new FGameConfigFile();
|
||||
|
@ -513,6 +528,30 @@ void G_ReadConfig(const char* game)
|
|||
{
|
||||
GameConfig->DoGameSetup(game);
|
||||
GameConfig->DoKeySetup(game);
|
||||
|
||||
// Process automatically executed files
|
||||
FExecList *exec;
|
||||
FArgs *execFiles = new FArgs;
|
||||
GameConfig->AddAutoexec(execFiles, game);
|
||||
exec = D_MultiExec(execFiles, NULL);
|
||||
delete execFiles;
|
||||
|
||||
// Process .cfg files at the start of the command line.
|
||||
execFiles = Args->GatherFiles ("-exec");
|
||||
exec = D_MultiExec(execFiles, exec);
|
||||
delete execFiles;
|
||||
|
||||
// [RH] process all + commands on the command line
|
||||
exec = C_ParseCmdLineParams(exec);
|
||||
|
||||
// Actually exec command line commands and exec files.
|
||||
if (exec != NULL)
|
||||
{
|
||||
exec->ExecCommands();
|
||||
delete exec;
|
||||
exec = NULL;
|
||||
}
|
||||
|
||||
FBaseCVar::EnableCallbacks();
|
||||
GameName = game;
|
||||
}
|
||||
|
|
|
@ -867,9 +867,6 @@ int RunGame()
|
|||
I_FatalError("There was a problem initializing the Build engine: %s\n", engineerrstr);
|
||||
}
|
||||
|
||||
auto exec = C_ParseCmdLineParams(nullptr);
|
||||
if (exec) exec->ExecCommands();
|
||||
|
||||
SetupGameButtons();
|
||||
gameinfo.mBackButton = "engine/graphics/m_back.png";
|
||||
gi->app_init();
|
||||
|
|
Loading…
Reference in a new issue