]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - fs.c
try to detect a .app package in MacOSX and use a basedir outside the .app
[xonotic/darkplaces.git] / fs.c
diff --git a/fs.c b/fs.c
index 904645d6811ae2de99ffd6e7621891cae18d6b73..6f7a4fc83a2829863396fd2cef3ff72203811924 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 ();