try to detect a .app package in MacOSX and use a basedir outside the .app
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 30 May 2005 21:58:45 +0000 (21:58 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 30 May 2005 21:58:45 +0000 (21:58 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5361 d7cf8633-e32d-0410-b094-e92efae38249

fs.c

diff --git a/fs.c b/fs.c
index 904645d..6f7a4fc 100644 (file)
--- a/fs.c
+++ b/fs.c
@@ -903,7 +903,13 @@ void FS_Init (void)
        fs_mempool = Mem_AllocPool("file management", 0, NULL);
 
        strcpy(fs_basedir, ".");
-       strcpy(fs_gamedir, ".");
+       strcpy(fs_gamedir, "");
+
+#ifdef MACOSX
+       // FIXME: is there a better way to find the directory outside the .app?
+       if (strstr(com_argv[0], ".app/"))
+               strcpy(fs_basedir, "../../..");
+#endif
 
        PK3_OpenLibrary ();