diff options
author | Andrey Nazarov <skuller@skuller.net> | 2007-09-19 15:08:09 +0000 |
---|---|---|
committer | Andrey Nazarov <skuller@skuller.net> | 2007-09-19 15:08:09 +0000 |
commit | 8e8adcc9688ac64c0d8b8528d27b7d4019df4cbf (patch) | |
tree | 30778c3b1a5b2b8989fbcc75c0c7ec84097b7dcd /source/files.c | |
parent | f987a0fdb10ae53965587117cc1e76873a512263 (diff) |
Fixed FS_ListFiles handling FS_PATH_GAME flag incorrectly.
Reset current demos directory when UI module is reinitialized.
Updated version to r161.
Diffstat (limited to 'source/files.c')
-rw-r--r-- | source/files.c | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/source/files.c b/source/files.c index 871f8c8..046cae7 100644 --- a/source/files.c +++ b/source/files.c @@ -654,7 +654,7 @@ static int FS_FOpenFileRead( fsFile_t *file, const char *name, qboolean unique ) if( !strcmp( ext, ".gz" ) ) { zfp = gzdopen( fileno( fp ), "rb" ); if( !zfp ) { - Com_WPrintf( "%s: %s: gzopen(rb) failed\n", + FS_DPrintf( "%s: %s: gzopen(rb) failed\n", __func__, file->fullpath ); fclose( fp ); return -1; @@ -1746,18 +1746,15 @@ char **FS_ListFiles( const char *path, const char *extension, if( !strcmp( path, "$modlist" ) ) { FS_GetModList( listedFiles, &count ); } else { - switch( flags & FS_PATH_MASK ) { - case FS_PATH_BASE: - search = fs_base_searchpaths; - break; - default: - search = fs_searchpaths; - break; - } - memset( &info, 0, sizeof( info ) ); - for( ; search; search = search->next ) { + for( search = FS_SearchPath( flags ); search; search = search->next ) { + if( ( flags & FS_PATH_MASK ) == FS_PATH_GAME ) { + if( fs_searchpaths != fs_base_searchpaths && search == fs_base_searchpaths ) { + // consider baseq2 a gamedir if no gamedir loaded + break; + } + } if( search->pack ) { if( ( flags & FS_TYPE_MASK ) == FS_TYPE_REAL ) { // don't search in paks @@ -1768,12 +1765,7 @@ char **FS_ListFiles( const char *path, const char *extension, if( ( flags & FS_SEARCHDIRS_MASK ) == FS_SEARCHDIRS_ONLY ) { continue; } - if( ( flags & FS_PATH_MASK ) == FS_PATH_GAME ) { - if( fs_searchpaths != fs_base_searchpaths && search == fs_base_searchpaths ) { - // consider baseq2 a gamedir if no gamedir loaded - break; - } - } + if( flags & FS_SEARCH_BYFILTER ) { for( i = 0; i < search->pack->numfiles; i++ ) { name = search->pack->files[i].name; |