diff options
Diffstat (limited to 'code/qcommon')
-rw-r--r-- | code/qcommon/files.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/code/qcommon/files.c b/code/qcommon/files.c index 52fa912..df90588 100644 --- a/code/qcommon/files.c +++ b/code/qcommon/files.c @@ -2483,7 +2483,6 @@ Sets fs_gamedir, adds the directory to the head of the path, then loads the zip headers ================ */ -#define MAX_PAKFILES 1024 static void FS_AddGameDirectory( const char *path, const char *dir ) { searchpath_t *sp; int i; @@ -2492,7 +2491,6 @@ static void FS_AddGameDirectory( const char *path, const char *dir ) { char *pakfile; int numfiles; char **pakfiles; - char *sorted[MAX_PAKFILES]; // this fixes the case where fs_basepath is the same as fs_cdpath // which happens on full installs @@ -2521,20 +2519,11 @@ static void FS_AddGameDirectory( const char *path, const char *dir ) { pakfiles = Sys_ListFiles( pakfile, ".pk3", NULL, &numfiles, qfalse ); - // sort them so that later alphabetic matches override - // earlier ones. This makes pak1.pk3 override pak0.pk3 - if ( numfiles > MAX_PAKFILES ) { - numfiles = MAX_PAKFILES; - } - for ( i = 0 ; i < numfiles ; i++ ) { - sorted[i] = pakfiles[i]; - } - - qsort( sorted, numfiles, sizeof(char*), paksort ); + qsort( pakfiles, numfiles, sizeof(char*), paksort ); for ( i = 0 ; i < numfiles ; i++ ) { - pakfile = FS_BuildOSPath( path, dir, sorted[i] ); - if ( ( pak = FS_LoadZipFile( pakfile, sorted[i] ) ) == 0 ) + pakfile = FS_BuildOSPath( path, dir, pakfiles[i] ); + if ( ( pak = FS_LoadZipFile( pakfile, pakfiles[i] ) ) == 0 ) continue; // store the game name for downloading strcpy(pak->pakGamename, dir); |