diff --git a/code/client/cl_console.c b/code/client/cl_console.c index da575a31..a4bb433b 100644 --- a/code/client/cl_console.c +++ b/code/client/cl_console.c @@ -309,7 +309,7 @@ Cmd_CompleteTxtName */ void Cmd_CompleteTxtName( char *args, int argNum ) { if( argNum == 2 ) { - Field_CompleteFilename( "", "txt", qfalse ); + Field_CompleteFilename( "", "txt", qfalse, qtrue ); } } diff --git a/code/client/cl_main.c b/code/client/cl_main.c index 1661b8fd..94cd70b4 100644 --- a/code/client/cl_main.c +++ b/code/client/cl_main.c @@ -911,7 +911,7 @@ static void CL_CompleteDemoName( char *args, int argNum ) char demoExt[ 16 ]; Com_sprintf( demoExt, sizeof( demoExt ), ".dm_%d", PROTOCOL_VERSION ); - Field_CompleteFilename( "demos", demoExt, qtrue ); + Field_CompleteFilename( "demos", demoExt, qtrue, qfalse ); } } diff --git a/code/qcommon/cmd.c b/code/qcommon/cmd.c index f40b5bd2..8103cd9c 100644 --- a/code/qcommon/cmd.c +++ b/code/qcommon/cmd.c @@ -784,7 +784,7 @@ Cmd_CompleteCfgName */ void Cmd_CompleteCfgName( char *args, int argNum ) { if( argNum == 2 ) { - Field_CompleteFilename( "", "cfg", qfalse ); + Field_CompleteFilename( "", "cfg", qfalse, qtrue ); } } diff --git a/code/qcommon/common.c b/code/qcommon/common.c index 0a60ee57..a0fcc6c6 100644 --- a/code/qcommon/common.c +++ b/code/qcommon/common.c @@ -3303,15 +3303,15 @@ Field_CompleteFilename =============== */ void Field_CompleteFilename( const char *dir, - const char *ext, qboolean stripExt ) + const char *ext, qboolean stripExt, qboolean allowNonPureFilesOnDisk ) { matchCount = 0; shortestMatch[ 0 ] = 0; - FS_FilenameCompletion( dir, ext, stripExt, FindMatches ); + FS_FilenameCompletion( dir, ext, stripExt, FindMatches, allowNonPureFilesOnDisk ); if( !Field_Complete( ) ) - FS_FilenameCompletion( dir, ext, stripExt, PrintMatches ); + FS_FilenameCompletion( dir, ext, stripExt, PrintMatches, allowNonPureFilesOnDisk ); } /* diff --git a/code/qcommon/files.c b/code/qcommon/files.c index f7cab814..b0b574a8 100644 --- a/code/qcommon/files.c +++ b/code/qcommon/files.c @@ -1862,7 +1862,7 @@ Returns a uniqued list of files that match the given criteria from all search paths =============== */ -char **FS_ListFilteredFiles( const char *path, const char *extension, char *filter, int *numfiles ) { +char **FS_ListFilteredFiles( const char *path, const char *extension, char *filter, int *numfiles, qboolean allowNonPureFilesOnDisk ) { int nfiles; char **listCopy; char *list[MAX_FOUND_FILES]; @@ -1958,7 +1958,7 @@ char **FS_ListFilteredFiles( const char *path, const char *extension, char *filt char *name; // don't scan directories for files if we are pure or restricted - if ( fs_numServerPaks ) { + if ( fs_numServerPaks && !allowNonPureFilesOnDisk ) { continue; } else { netpath = FS_BuildOSPath( search->dir->path, search->dir->gamedir, path ); @@ -1995,7 +1995,7 @@ FS_ListFiles ================= */ char **FS_ListFiles( const char *path, const char *extension, int *numfiles ) { - return FS_ListFilteredFiles( path, extension, NULL, numfiles ); + return FS_ListFilteredFiles( path, extension, NULL, numfiles, qfalse ); } /* @@ -2374,7 +2374,7 @@ void FS_NewDir_f( void ) { Com_Printf( "---------------\n" ); - dirnames = FS_ListFilteredFiles( "", "", filter, &ndirs ); + dirnames = FS_ListFilteredFiles( "", "", filter, &ndirs, qfalse ); FS_SortFileList(dirnames, ndirs); @@ -3606,13 +3606,13 @@ void FS_Flush( fileHandle_t f ) { } void FS_FilenameCompletion( const char *dir, const char *ext, - qboolean stripExt, void(*callback)(const char *s) ) { + qboolean stripExt, void(*callback)(const char *s), qboolean allowNonPureFilesOnDisk ) { char **filenames; int nfiles; int i; char filename[ MAX_STRING_CHARS ]; - filenames = FS_ListFilteredFiles( dir, ext, NULL, &nfiles ); + filenames = FS_ListFilteredFiles( dir, ext, NULL, &nfiles, allowNonPureFilesOnDisk ); FS_SortFileList( filenames, nfiles ); diff --git a/code/qcommon/qcommon.h b/code/qcommon/qcommon.h index db088051..a9a8b565 100644 --- a/code/qcommon/qcommon.h +++ b/code/qcommon/qcommon.h @@ -715,7 +715,7 @@ void FS_Remove( const char *osPath ); void FS_HomeRemove( const char *homePath ); void FS_FilenameCompletion( const char *dir, const char *ext, - qboolean stripExt, void(*callback)(const char *s) ); + qboolean stripExt, void(*callback)(const char *s), qboolean allowNonPureFilesOnDisk ); const char *FS_GetCurrentGameDir(void); @@ -739,7 +739,7 @@ void Field_Clear( field_t *edit ); void Field_AutoComplete( field_t *edit ); void Field_CompleteKeyname( void ); void Field_CompleteFilename( const char *dir, - const char *ext, qboolean stripExt ); + const char *ext, qboolean stripExt, qboolean allowNonPureFilesOnDisk ); void Field_CompleteCommand( char *cmd, qboolean doCommands, qboolean doCvars ); diff --git a/code/server/sv_ccmds.c b/code/server/sv_ccmds.c index 508faea9..3eb7e9e5 100644 --- a/code/server/sv_ccmds.c +++ b/code/server/sv_ccmds.c @@ -1253,7 +1253,7 @@ SV_CompleteMapName */ static void SV_CompleteMapName( char *args, int argNum ) { if( argNum == 2 ) { - Field_CompleteFilename( "maps", "bsp", qtrue ); + Field_CompleteFilename( "maps", "bsp", qtrue, qfalse ); } }