- added missing game specific autoload handler.

This commit is contained in:
Christoph Oelckers 2020-05-22 01:24:40 +02:00
parent 45cc95401f
commit 683672a1be
2 changed files with 10 additions and 10 deletions

View file

@ -475,7 +475,7 @@ void FGameConfigFile::AddAutoexec (FArgs *list, const char *game)
const char *key; const char *key;
const char *value; const char *value;
snprintf (section, countof(section), "%s.AutoLoad", game); snprintf (section, countof(section), "%s.AutoExec", game);
// If <game>.AutoLoad section does not exist, create it // If <game>.AutoLoad section does not exist, create it
// with a default autoexec.cfg file present. // with a default autoexec.cfg file present.

View file

@ -324,16 +324,16 @@ void InitFileSystem(TArray<GrpEntry>& groups)
const char* key; const char* key;
const char* value; const char* value;
if (GameConfig->SetSection("global.Autoload")) D_AddConfigFiles(Files, "Global.Autoload", "*.grp", GameConfig);
long len;
int lastpos = 0;
while (lastpos < LumpFilter.Len() && (len = strcspn(LumpFilter.GetChars() + lastpos, ".")) > 0)
{ {
while (GameConfig->NextInSection(key, value)) auto file = LumpFilter.Left(len + lastpos) + ".Autoload";
{ D_AddConfigFiles(Files, file, "*.grp", GameConfig);
if (stricmp(key, "Path") == 0) lastpos += len + 1;
{
FString nice = NicePath(value);
D_AddFile(Files, nice, true, -1, GameConfig);
}
}
} }
if (!insertdirectoriesafter && userConfig.AddFilesPre) for (auto& file : *userConfig.AddFilesPre) if (!insertdirectoriesafter && userConfig.AddFilesPre) for (auto& file : *userConfig.AddFilesPre)