]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/mainframe.cpp
q3map2: code simplification
[xonotic/netradiant.git] / radiant / mainframe.cpp
index 1d3660f5c7c44060bd22e1c815dc5f80fbabfb2b..225a7d5e5fba955486817c08b7dc842f9a0636ed 100644 (file)
@@ -254,11 +254,19 @@ void HomePaths_Realise(){
                        }
 #endif
 
-#if GDEF_OS_POSIX
+#if (GDEF_OS_POSIX && !GDEF_OS_MACOS)
                        path.clear();
-                       path << DirectoryCleaned( g_get_home_dir() ) << prefix << "/";
-                       g_qeglobals.m_userEnginePath = path.c_str();
-                       break;
+                       path << DirectoryCleaned( g_get_user_data_dir() ) << ( prefix + 1 ) << "/";
+                       if ( file_exists( path.c_str() ) && file_is_directory( path.c_str() ) ) {
+                               g_qeglobals.m_userEnginePath = path.c_str();
+                               break;
+                       }
+                       else {
+                               path.clear();
+                               path << DirectoryCleaned( g_get_home_dir() ) << prefix << "/";
+                               g_qeglobals.m_userEnginePath = path.c_str();
+                               break;
+                       }
 #endif
                }
 
@@ -437,11 +445,23 @@ void setPakPath( int num, const char* path ){
 // App Path
 
 CopiedString g_strAppPath;                 ///< holds the full path of the executable
+CopiedString g_strLibPath;
+CopiedString g_strDataPath;
 
 const char* AppPath_get(){
        return g_strAppPath.c_str();
 }
 
+const char *LibPath_get()
+{
+    return g_strLibPath.c_str();
+}
+
+const char *DataPath_get()
+{
+    return g_strDataPath.c_str();
+}
+
 /// the path to the local rc-dir
 const char* LocalRcPath_get( void ){
        static CopiedString rc_path;
@@ -753,7 +773,7 @@ void Radiant_detachGameToolsPathObserver( ModuleObserver& observer ){
 void Radiant_Initialise(){
        GlobalModuleServer_Initialise();
 
-       Radiant_loadModulesFromRoot( AppPath_get() );
+       Radiant_loadModulesFromRoot( LibPath_get() );
 
        Preferences_Load();