- fixed addition of main directory.

This commit is contained in:
Christoph Oelckers 2019-11-02 18:46:11 +01:00
parent 395ba5541c
commit c5838df0c8
2 changed files with 8 additions and 7 deletions

View file

@ -320,13 +320,14 @@ void InitFileSystem(TArray<GrpEntry>& groups)
FString newname = fn + fname; FString newname = fn + fname;
D_AddFile(Files, newname); D_AddFile(Files, newname);
} }
bool insert = (!insertdirectoriesafter && &grp == &groups[0]) || (insertdirectoriesafter && &grp == &groups.Last());
// Add the game's main directory in the proper spot. // Add the game's main directory in the proper spot.
if ((i == (insertdirectoriesafter ? 0 : dependencies.Size() - 1)) || grp.FileInfo.loaddirectory) if (insert)
{ {
// Build's original 'file system' loads all GRPs before the first external directory. // Build's original 'file system' loads all GRPs before the first external directory.
// Do this only if explicitly requested because this severely limits the usability of GRP files. // Do this only if explicitly requested because this severely limits the usability of GRP files.
if (insertdirectoriesafter && i == 0) for (auto& file : *userConfig.AddFilesPre) if (insertdirectoriesafter) for (auto& file : *userConfig.AddFilesPre)
{ {
D_AddFile(Files, file); D_AddFile(Files, file);
} }

View file

@ -1086,7 +1086,7 @@ const char* G_DefaultConFile(void)
if (g_gameType & GAMEFLAG_WW2GI) if (g_gameType & GAMEFLAG_WW2GI)
{ {
if (fileSystem.FindFile("ww2gi.con")) return "ww2gi.con"; if (fileSystem.FindFile("ww2gi.con") >= 0) return "ww2gi.con";
} }
if (g_gameType & GAMEFLAG_SW) if (g_gameType & GAMEFLAG_SW)
@ -1094,14 +1094,14 @@ const char* G_DefaultConFile(void)
if (g_gameType & GAMEFLAG_NAM) if (g_gameType & GAMEFLAG_NAM)
{ {
if (fileSystem.FindFile("nam.def")) return "nam.def"; if (fileSystem.FindFile("nam.con") >= 0) return "nam.con";
if (fileSystem.FindFile("napalm.def")) return "napalm.def"; if (fileSystem.FindFile("napalm.con") >= 0) return "napalm.con";
} }
if (g_gameType & GAMEFLAG_NAPALM) if (g_gameType & GAMEFLAG_NAPALM)
{ {
if (fileSystem.FindFile("napalm.def")) return "napalm.def"; if (fileSystem.FindFile("napalm.con") >= 0) return "napalm.con";
if (fileSystem.FindFile("nam.def")) return "nam.def"; if (fileSystem.FindFile("nam.con") >= 0) return "nam.con";
} }
// the other games only use game.con. // the other games only use game.con.