allow AddFilestoList to search without extension

This commit is contained in:
rexx 2023-05-08 16:12:37 +01:00
parent 359820615f
commit fc16e61deb
2 changed files with 2 additions and 2 deletions

View File

@ -27,7 +27,7 @@ void ComputeModContentFilename( const char *pGameFileName, char *pBuf, size_t nB
void RecursiveFindFilesMatchingName( CUtlVector< CUtlString > *pOutFileList, const char* szStartDirectory, const char* szTargetFileName, const char *pPathID );
// Builds a list of all files under a directory with a particular extension.
void AddFilesToList( CUtlVector< CUtlString > &list, const char *pDirectory, const char *pPath, const char *pExtension );
void AddFilesToList( CUtlVector< CUtlString > &list, const char *pDirectory, const char *pPath = nullptr, const char *pExtension = nullptr );
// Returns the search path as a list of paths.
void GetSearchPath( CUtlVector< CUtlString > &path, const char *pPathID );

View File

@ -178,7 +178,7 @@ void AddFilesToList( CUtlVector< CUtlString > &list, const char *pDirectory, con
}
// Check the extension matches.
if ( Q_stricmp( V_GetFileExtension( pFoundFile ), pExtension ) )
if ( pExtension && Q_stricmp( V_GetFileExtension( pFoundFile ), pExtension ) )
continue;
char pFullPathBuf[MAX_PATH];