Fix addon and configuration file paths
authorPerttu Ahola <celeron55@gmail.com>
Sat, 10 Mar 2012 14:10:26 +0000 (16:10 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Sat, 10 Mar 2012 15:10:16 +0000 (17:10 +0200)
src/main.cpp
src/server.cpp
src/servermain.cpp

index 322d84e9e0896d9ef6666bb542b4828da207ab5f..46fe4715d1a64413a5d956fb1eae513c10978319 100644 (file)
@@ -1222,11 +1222,14 @@ int main(int argc, char *argv[])
                core::array<std::string> filenames;
                filenames.push_back(porting::path_user +
                                DIR_DELIM + "minetest.conf");
+               // Legacy configuration file location
+               filenames.push_back(porting::path_user +
+                               DIR_DELIM + ".." + DIR_DELIM + "minetest.conf");
 #ifdef RUN_IN_PLACE
                // Try also from a lower level (to aid having the same configuration
                // for many RUN_IN_PLACE installs)
                filenames.push_back(porting::path_user +
-                               DIR_DELIM + ".." + DIR_DELIM + "minetest.conf");
+                               DIR_DELIM + ".." + DIR_DELIM + ".." + DIR_DELIM + "minetest.conf");
 #endif
 
                for(u32 i=0; i<filenames.size(); i++)
index 69f655e6acd7b244a2bc4a7cdd62dca0f8d96281..38cedd061ed02f8970512fb70e36d69cf33119e3 100644 (file)
@@ -886,6 +886,10 @@ Server::Server(
        // Figure out some paths
        m_path_share = porting::path_share + DIR_DELIM + "server";
        m_path_game = m_path_share + DIR_DELIM + "games" + DIR_DELIM + m_gamename;
+       m_path_addons.insert(m_path_share + DIR_DELIM + "addons"
+                       + DIR_DELIM + m_gamename);
+       m_path_addons.insert(porting::path_user + DIR_DELIM + "server"
+                       + DIR_DELIM + "addons" + DIR_DELIM + m_gamename);
 
        // Path to builtin.lua
        std::string builtinpath = m_path_share + DIR_DELIM + "builtin.lua";
index 5eb5162ae9eaf3c19e1c7e4d322b38e91c36155a..9be0c80ae9ea984d9d11632ffed71d865afe114f 100644 (file)
@@ -284,11 +284,14 @@ int main(int argc, char *argv[])
                core::array<std::string> filenames;
                filenames.push_back(porting::path_user +
                                DIR_DELIM + "minetest.conf");
+               // Legacy configuration file location
+               filenames.push_back(porting::path_user +
+                               DIR_DELIM + ".." + DIR_DELIM + "minetest.conf");
 #ifdef RUN_IN_PLACE
                // Try also from a lower level (to aid having the same configuration
                // for many RUN_IN_PLACE installs)
                filenames.push_back(porting::path_user +
-                               DIR_DELIM + ".." + DIR_DELIM + "minetest.conf");
+                               DIR_DELIM + ".." + DIR_DELIM + ".." + DIR_DELIM + "minetest.conf");
 #endif
 
                for(u32 i=0; i<filenames.size(); i++)