Load maps.lst and files under players/ from disk first.

Added check in FS_FileInPakBlacklist() for certain files that should be loaded from disk first.
Then check for local file in gamedir.  If present, ignore file in pak.
This commit is contained in:
Knightmare66 2019-06-11 20:51:34 -04:00
parent de8072c9e0
commit faff1135e9
2 changed files with 24 additions and 0 deletions

View file

@ -49,6 +49,8 @@ Changes as of v0.20 update 8:
- Fixed crash when patching dead soldier model.
- Now ignores maps.lst file inside pak/pk3 files when the same file can be loaded from outside paks in the same game folder.
- Removed target_animation from Lazarus DLL, as it breaks when loading/saving game and there's no good way
to implement it properly.

View file

@ -1477,6 +1477,13 @@ char *pakfile_ignore_names[] =
0
};
// These files are sometimes inside paks, but should be loaded externally first
char *pakfile_tryExtFirst_names[] =
{
"players/",
"maps.lst",
0
};
/*
=================
@ -1491,6 +1498,7 @@ qboolean FS_FileInPakBlacklist (char *filename, qboolean isPk3)
int i;
char *compare;
qboolean ignore = false;
qboolean loadExtFirst = false;
compare = filename;
if (compare[0] == '/') // remove leading slash
@ -1503,6 +1511,20 @@ qboolean FS_FileInPakBlacklist (char *filename, qboolean isPk3)
// if ( !isPk3 && !strcmp(COM_FileExtension(compare), "ogg") )
// ignore = true;
}
if (!ignore) // see if a file should be loaded from outside paks first
{
for (i=0; pakfile_tryExtFirst_names[i]; i++) {
if ( !Q_strncasecmp(compare, pakfile_tryExtFirst_names[i], strlen(pakfile_tryExtFirst_names[i])) )
loadExtFirst = true;
}
if (loadExtFirst)
{
if (FS_LocalFileExists(compare)) {
// Com_Printf ("FS_LoadPAK: file %s in pack is ignored in favor of external file first.\n", filename);
ignore = true;
}
}
}
// if (ignore)
// Com_Printf ("FS_LoadPAK: file %s blacklisted!\n", filename);