1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00: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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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