diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-01-07 19:39:27 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-01-07 19:39:27 +0200 |
commit | 6b6c2d37ea1f9075c4fbf0d7e2d52e527e1f86aa (patch) | |
tree | 16ab23387dc95d0f42e6519e500d4024e2a2f826 /src/servermain.cpp | |
parent | dc414091e736badc6fd2faa6a2583639a3458818 (diff) | |
download | minetest-6b6c2d37ea1f9075c4fbf0d7e2d52e527e1f86aa.tar.gz minetest-6b6c2d37ea1f9075c4fbf0d7e2d52e527e1f86aa.tar.bz2 minetest-6b6c2d37ea1f9075c4fbf0d7e2d52e527e1f86aa.zip |
Added a more flexible path system (and fixed some minor stuff)
Diffstat (limited to 'src/servermain.cpp')
-rw-r--r-- | src/servermain.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/servermain.cpp b/src/servermain.cpp index 01919a7df..7dcc304a0 100644 --- a/src/servermain.cpp +++ b/src/servermain.cpp @@ -123,6 +123,8 @@ int main(int argc, char *argv[]) DSTACK(__FUNCTION_NAME); + porting.initializePaths(); + initializeMaterialProperties(); BEGIN_DEBUG_EXCEPTION_HANDLER @@ -222,15 +224,12 @@ int main(int argc, char *argv[]) } else { - const char *filenames[2] = - { - "../minetest.conf", - "../../minetest.conf" - }; + core::array<std::string> filenames; + filenames.push_back(porting::path_userdata + "/minetest.conf"); - for(u32 i=0; i<2; i++) + for(u32 i=0; i<filenames.size(); i++) { - bool r = g_settings.readConfigFile(filenames[i]); + bool r = g_settings.readConfigFile(filenames[i].c_str()); if(r) { configpath = filenames[i]; @@ -306,7 +305,7 @@ int main(int argc, char *argv[]) std::cout<<std::endl; // Figure out path to map - std::string map_dir = "../map"; + std::string map_dir = porting::path_userdata+"/map"; if(cmd_args.exists("map-dir")) map_dir = cmd_args.get("map-dir"); |