- 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 *value;
snprintf (section, countof(section), "%s.AutoLoad", game);
snprintf (section, countof(section), "%s.AutoExec", game);
// If <game>.AutoLoad section does not exist, create it
// with a default autoexec.cfg file present.

View File

@ -324,16 +324,16 @@ void InitFileSystem(TArray<GrpEntry>& groups)
const char* key;
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))
{
if (stricmp(key, "Path") == 0)
{
FString nice = NicePath(value);
D_AddFile(Files, nice, true, -1, GameConfig);
}
}
auto file = LumpFilter.Left(len + lastpos) + ".Autoload";
D_AddConfigFiles(Files, file, "*.grp", GameConfig);
lastpos += len + 1;
}
if (!insertdirectoriesafter && userConfig.AddFilesPre) for (auto& file : *userConfig.AddFilesPre)