Change where games looks for mods from mods/ to files/
This commit is contained in:
parent
79a49474ce
commit
96504404e6
@ -722,7 +722,7 @@ int ModApiMainMenu::l_get_mapgen_names(lua_State *L)
|
||||
int ModApiMainMenu::l_get_modpath(lua_State *L)
|
||||
{
|
||||
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());
|
||||
return 1;
|
||||
}
|
||||
@ -944,7 +944,7 @@ bool ModApiMainMenu::isMinetestPath(std::string path)
|
||||
return true;
|
||||
|
||||
/* 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;
|
||||
|
||||
/* worlds */
|
||||
|
@ -113,13 +113,13 @@ SubgameSpec findSubgame(const std::string &id)
|
||||
}
|
||||
if(game_path == "")
|
||||
return SubgameSpec();
|
||||
std::string gamemod_path = game_path + DIR_DELIM + "mods";
|
||||
std::string gamemod_path = game_path + DIR_DELIM + "files";
|
||||
// Find mod directories
|
||||
std::set<std::string> mods_paths;
|
||||
if(!user_game)
|
||||
mods_paths.insert(share + DIR_DELIM + "mods");
|
||||
mods_paths.insert(share + DIR_DELIM + "files");
|
||||
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);
|
||||
if(game_name == "")
|
||||
game_name = id;
|
||||
@ -140,7 +140,7 @@ SubgameSpec findWorldSubgame(const std::string &world_path)
|
||||
SubgameSpec gamespec;
|
||||
gamespec.id = world_gameid;
|
||||
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);
|
||||
if(gamespec.name == "")
|
||||
gamespec.name = "unknown";
|
||||
|
Loading…
x
Reference in New Issue
Block a user