1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Fix mod paths

This commit is contained in:
Perttu Ahola 2012-03-20 01:06:44 +02:00
parent db4911f956
commit 50621ffe85
3 changed files with 17 additions and 23 deletions

View file

@ -38,14 +38,16 @@ SubgameSpec findSubgame(const std::string &id)
}
if(!fs::PathExists(game_path))
return SubgameSpec();
// Find addon directories
std::set<std::string> addon_paths;
// Find mod directories
std::set<std::string> mods_paths;
mods_paths.insert(game_path + DIR_DELIM + "mods");
if(!user_game)
addon_paths.insert(share + DIR_DELIM + "addons" + DIR_DELIM + id);
addon_paths.insert(user + DIR_DELIM + "addons" + DIR_DELIM + id);
mods_paths.insert(share + DIR_DELIM + "mods" + DIR_DELIM + id);
if(user != share || user_game)
mods_paths.insert(user + DIR_DELIM + "mods" + DIR_DELIM + id);
// TODO: Read proper name from game_path/game.conf
std::string game_name = id;
return SubgameSpec(id, game_path, addon_paths, game_name);
return SubgameSpec(id, game_path, mods_paths, game_name);
}
std::set<std::string> getAvailableGameIds()