mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
search for .gz first
This commit is contained in:
parent
942b3c2744
commit
93febb90c9
1 changed files with 24 additions and 13 deletions
|
@ -428,12 +428,15 @@ _COM_FOpenFile (const char *filename, VFile **gzfile, char *foundname, int zip)
|
|||
if (search->pack) {
|
||||
packfile_t *packfile;
|
||||
|
||||
packfile = (packfile_t *) Hash_Find (search->pack->file_hash,
|
||||
filename);
|
||||
#ifdef HAVE_ZLIB
|
||||
packfile = (packfile_t *) Hash_Find (search->pack->file_hash,
|
||||
gzfilename);
|
||||
if (!packfile)
|
||||
packfile = (packfile_t *) Hash_Find (search->pack->file_hash,
|
||||
gzfilename);
|
||||
filename);
|
||||
#else
|
||||
packfile = (packfile_t *) Hash_Find (search->pack->file_hash,
|
||||
filename);
|
||||
#endif
|
||||
if (packfile) {
|
||||
Sys_DPrintf ("PackFile: %s : %s\n", search->pack->filename,
|
||||
|
@ -448,22 +451,30 @@ _COM_FOpenFile (const char *filename, VFile **gzfile, char *foundname, int zip)
|
|||
}
|
||||
} else {
|
||||
// check a file in the directory tree
|
||||
#ifdef HAVE_ZLIB
|
||||
snprintf (netpath, sizeof (netpath), "%s%s%s", search->filename,
|
||||
search->filename[0] ? "/" : "", gzfilename);
|
||||
|
||||
strncpy (foundname, gzfilename, MAX_OSPATH);
|
||||
findtime = Sys_FileTime (netpath);
|
||||
if (findtime == -1) {
|
||||
strncpy (foundname, filename, MAX_OSPATH);
|
||||
snprintf (netpath, sizeof (netpath), "%s%s%s",
|
||||
search->filename,
|
||||
search->filename[0] ? "/" : "", filename);
|
||||
findtime = Sys_FileTime (netpath);
|
||||
if (findtime == -1)
|
||||
continue;
|
||||
}
|
||||
#else
|
||||
snprintf (netpath, sizeof (netpath), "%s%s%s", search->filename,
|
||||
search->filename[0] ? "/" : "", filename);
|
||||
|
||||
strncpy (foundname, filename, MAX_OSPATH);
|
||||
findtime = Sys_FileTime (netpath);
|
||||
if (findtime == -1) {
|
||||
#ifdef HAVE_ZLIB
|
||||
strncpy (foundname, gzfilename, MAX_OSPATH);
|
||||
snprintf (netpath, sizeof (netpath), "%s%s%s",
|
||||
search->filename,
|
||||
search->filename[0] ? "/" : "", gzfilename);
|
||||
findtime = Sys_FileTime (netpath);
|
||||
if (findtime == -1)
|
||||
if (findtime == -1)
|
||||
continue;
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
|
||||
Sys_DPrintf ("FindFile: %s\n", netpath);
|
||||
|
||||
|
|
Loading…
Reference in a new issue