Change where games looks for mods from mods/ to files/

This commit is contained in:
OttoLidenbrock 2015-05-19 12:17:41 +10:00
parent 79a49474ce
commit 96504404e6
2 changed files with 6 additions and 6 deletions

View File

@ -722,7 +722,7 @@ int ModApiMainMenu::l_get_mapgen_names(lua_State *L)
int ModApiMainMenu::l_get_modpath(lua_State *L) int ModApiMainMenu::l_get_modpath(lua_State *L)
{ {
std::string modpath std::string modpath
= fs::RemoveRelativePathComponents(porting::path_user + DIR_DELIM + "mods" + DIR_DELIM); = fs::RemoveRelativePathComponents(porting::path_user + DIR_DELIM + "files" + DIR_DELIM);
lua_pushstring(L, modpath.c_str()); lua_pushstring(L, modpath.c_str());
return 1; return 1;
} }
@ -944,7 +944,7 @@ bool ModApiMainMenu::isMinetestPath(std::string path)
return true; return true;
/* mods */ /* mods */
if (fs::PathStartsWith(path,fs::RemoveRelativePathComponents(porting::path_user + DIR_DELIM + "mods"))) if (fs::PathStartsWith(path,fs::RemoveRelativePathComponents(porting::path_user + DIR_DELIM + "files")))
return true; return true;
/* worlds */ /* worlds */

View File

@ -113,13 +113,13 @@ SubgameSpec findSubgame(const std::string &id)
} }
if(game_path == "") if(game_path == "")
return SubgameSpec(); return SubgameSpec();
std::string gamemod_path = game_path + DIR_DELIM + "mods"; std::string gamemod_path = game_path + DIR_DELIM + "files";
// Find mod directories // Find mod directories
std::set<std::string> mods_paths; std::set<std::string> mods_paths;
if(!user_game) if(!user_game)
mods_paths.insert(share + DIR_DELIM + "mods"); mods_paths.insert(share + DIR_DELIM + "files");
if(user != share || user_game) if(user != share || user_game)
mods_paths.insert(user + DIR_DELIM + "mods"); mods_paths.insert(user + DIR_DELIM + "files");
std::string game_name = getGameName(game_path); std::string game_name = getGameName(game_path);
if(game_name == "") if(game_name == "")
game_name = id; game_name = id;
@ -140,7 +140,7 @@ SubgameSpec findWorldSubgame(const std::string &world_path)
SubgameSpec gamespec; SubgameSpec gamespec;
gamespec.id = world_gameid; gamespec.id = world_gameid;
gamespec.path = world_gamepath; gamespec.path = world_gamepath;
gamespec.gamemods_path= world_gamepath + DIR_DELIM + "mods"; gamespec.gamemods_path= world_gamepath + DIR_DELIM + "files";
gamespec.name = getGameName(world_gamepath); gamespec.name = getGameName(world_gamepath);
if(gamespec.name == "") if(gamespec.name == "")
gamespec.name = "unknown"; gamespec.name = "unknown";