summaryrefslogtreecommitdiff
path: root/src/content/subgames.cpp
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2022-01-30 22:40:53 +0000
committerGitHub <noreply@github.com>2022-01-30 22:40:53 +0000
commit128f6359e936bcdc5e26409ddd73438bce9c6dd6 (patch)
treef4d396d479ae17f57f25ab78df300256e28d5945 /src/content/subgames.cpp
parent8c0331d2449cf71049c7ce9c06d141e2846ebcb0 (diff)
downloadminetest-128f6359e936bcdc5e26409ddd73438bce9c6dd6.tar.gz
minetest-128f6359e936bcdc5e26409ddd73438bce9c6dd6.tar.bz2
minetest-128f6359e936bcdc5e26409ddd73438bce9c6dd6.zip
Use virtual paths to specify exact mod to enable (#11784)
Diffstat (limited to 'src/content/subgames.cpp')
-rw-r--r--src/content/subgames.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/content/subgames.cpp b/src/content/subgames.cpp
index 62e82e0e4..23355990e 100644
--- a/src/content/subgames.cpp
+++ b/src/content/subgames.cpp
@@ -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