From: divverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Date: Sat, 9 Jan 2010 18:46:56 +0000 (+0000)
Subject: also support the .dir and .d extensions for virtual packs
X-Git-Tag: xonotic-v0.1.0preview~230^2~648
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=46534e46c82c4a8e3822cbdf2b43a260a14f0f30;p=xonotic%2Fdarkplaces.git

also support the .dir and .d extensions for virtual packs

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9819 d7cf8633-e32d-0410-b094-e92efae38249
---

diff --git a/fs.c b/fs.c
index 669f8b32..c2207f08 100644
--- 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