1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-13 08:35:20 +02:00

Use virtual paths to specify exact mod to enable (#11784)

This commit is contained in:
rubenwardy
2022-01-30 22:40:53 +00:00
committed by GitHub
parent 8c0331d244
commit 128f6359e9
11 changed files with 223 additions and 80 deletions

View File

@@ -107,14 +107,13 @@ SubgameSpec findSubgame(const std::string &id)
std::string gamemod_path = game_path + DIR_DELIM + "mods";
// Find mod directories
std::set<std::string> mods_paths;
if (!user_game)
mods_paths.insert(share + DIR_DELIM + "mods");
if (user != share || user_game)
mods_paths.insert(user + DIR_DELIM + "mods");
std::unordered_map<std::string, std::string> mods_paths;
mods_paths["mods"] = user + DIR_DELIM + "mods";
if (!user_game && user != share)
mods_paths["share"] = share + DIR_DELIM + "mods";
for (const std::string &mod_path : getEnvModPaths()) {
mods_paths.insert(mod_path);
mods_paths[fs::AbsolutePath(mod_path)] = mod_path;
}
// Get meta