also support the .dir and .d extensions for virtual packs
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 9 Jan 2010 18:46:56 +0000 (18:46 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 9 Jan 2010 18:46:56 +0000 (18:46 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9819 d7cf8633-e32d-0410-b094-e92efae38249

fs.c

diff --git a/fs.c b/fs.c
index 669f8b3..c2207f0 100644 (file)
--- a/fs.c
+++ b/fs.c
@@ -1153,6 +1153,16 @@ void FS_AddGameDirectory (const char *dir)
                }
        }
 
+       // add any virtual packs in the directory
+       for (i = 0;i < list.numstrings;i++)
+       {
+               if (!strcasecmp(FS_FileExtension(list.strings[i]), "dir") || (!strcasecmp(FS_FileExtension(list.strings[i]), "d"))
+                       // we don't want precedence of .d vs .dir, but use the name as primary key
+               {
+                       FS_AddPack_Fullpath(list.strings[i], list.strings[i] + strlen(dir), NULL, false);
+               }
+       }
+
        stringlistfreecontents(&list);
 
        // Add the directory to the search path