Fix serverlist on -DRUN_IN_PLACE=0 (use path_user instead of path_share)
authorZeg9 <dazeg9@gmail.com>
Fri, 12 Apr 2013 10:58:04 +0000 (12:58 +0200)
committerPilzAdam <pilzadam@minetest.net>
Thu, 25 Apr 2013 17:49:28 +0000 (19:49 +0200)
src/serverlist.cpp

index 93f9d2435dea91020c4ccb3bbd12305aa720db77..7053436d055e42b7dc2e06e7c93820a567110201 100644 (file)
@@ -38,10 +38,12 @@ std::string getFilePath()
 {
        std::string serverlist_file = g_settings->get("serverlist_file");
 
-       std::string rel_path = std::string("client") + DIR_DELIM
-               + "serverlist" + DIR_DELIM
-               + serverlist_file;
-       std::string path = porting::path_share + DIR_DELIM + rel_path;
+       std::string dir_path = std::string("client") + DIR_DELIM
+               + "serverlist" + DIR_DELIM;
+       fs::CreateDir(porting::path_user + DIR_DELIM + "client");
+       fs::CreateDir(porting::path_user + DIR_DELIM + dir_path);
+       std::string rel_path = dir_path + serverlist_file;
+       std::string path = porting::path_user + DIR_DELIM + rel_path;
        return path;
 }