Fix addon and configuration file paths

master
Perttu Ahola 2012-03-10 16:10:26 +02:00
parent c89d1cf072
commit 1020707918
3 changed files with 12 additions and 2 deletions

View File

@ -1222,11 +1222,14 @@ int main(int argc, char *argv[])
core::array<std::string> filenames; core::array<std::string> filenames;
filenames.push_back(porting::path_user + filenames.push_back(porting::path_user +
DIR_DELIM + "minetest.conf"); DIR_DELIM + "minetest.conf");
// Legacy configuration file location
filenames.push_back(porting::path_user +
DIR_DELIM + ".." + DIR_DELIM + "minetest.conf");
#ifdef RUN_IN_PLACE #ifdef RUN_IN_PLACE
// Try also from a lower level (to aid having the same configuration // Try also from a lower level (to aid having the same configuration
// for many RUN_IN_PLACE installs) // for many RUN_IN_PLACE installs)
filenames.push_back(porting::path_user + filenames.push_back(porting::path_user +
DIR_DELIM + ".." + DIR_DELIM + "minetest.conf"); DIR_DELIM + ".." + DIR_DELIM + ".." + DIR_DELIM + "minetest.conf");
#endif #endif
for(u32 i=0; i<filenames.size(); i++) for(u32 i=0; i<filenames.size(); i++)

View File

@ -886,6 +886,10 @@ Server::Server(
// Figure out some paths // Figure out some paths
m_path_share = porting::path_share + DIR_DELIM + "server"; m_path_share = porting::path_share + DIR_DELIM + "server";
m_path_game = m_path_share + DIR_DELIM + "games" + DIR_DELIM + m_gamename; 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 // Path to builtin.lua
std::string builtinpath = m_path_share + DIR_DELIM + "builtin.lua"; std::string builtinpath = m_path_share + DIR_DELIM + "builtin.lua";

View File

@ -284,11 +284,14 @@ int main(int argc, char *argv[])
core::array<std::string> filenames; core::array<std::string> filenames;
filenames.push_back(porting::path_user + filenames.push_back(porting::path_user +
DIR_DELIM + "minetest.conf"); DIR_DELIM + "minetest.conf");
// Legacy configuration file location
filenames.push_back(porting::path_user +
DIR_DELIM + ".." + DIR_DELIM + "minetest.conf");
#ifdef RUN_IN_PLACE #ifdef RUN_IN_PLACE
// Try also from a lower level (to aid having the same configuration // Try also from a lower level (to aid having the same configuration
// for many RUN_IN_PLACE installs) // for many RUN_IN_PLACE installs)
filenames.push_back(porting::path_user + filenames.push_back(porting::path_user +
DIR_DELIM + ".." + DIR_DELIM + "minetest.conf"); DIR_DELIM + ".." + DIR_DELIM + ".." + DIR_DELIM + "minetest.conf");
#endif #endif
for(u32 i=0; i<filenames.size(); i++) for(u32 i=0; i<filenames.size(); i++)