aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2022-05-07 16:44:46 +0100
committerrubenwardy <rw@rubenwardy.com>2022-07-14 22:12:54 +0100
commit06de82fd86678e0a1c260c67792c5cd192863edd (patch)
tree82f7fb040860fd3d099ddce43be2710b120da083 /src/client
parent1d512ef7f4071fadf10078825ce83e77a3707f06 (diff)
downloadminetest-06de82fd86678e0a1c260c67792c5cd192863edd.tar.gz
minetest-06de82fd86678e0a1c260c67792c5cd192863edd.tar.bz2
minetest-06de82fd86678e0a1c260c67792c5cd192863edd.zip
Refactor ModConfiguration
Diffstat (limited to 'src/client')
-rw-r--r--src/client/client.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/client/client.cpp b/src/client/client.cpp
index 0f8297080..31bbf2463 100644
--- a/src/client/client.cpp
+++ b/src/client/client.cpp
@@ -58,6 +58,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "game.h"
#include "chatmessage.h"
#include "translation.h"
+#include "content/mod_configuration.h"
extern gui::IGUIEnvironment* guienv;
@@ -196,7 +197,21 @@ void Client::loadMods()
scanModIntoMemory(BUILTIN_MOD_NAME, getBuiltinLuaPath());
m_script->loadModFromMemory(BUILTIN_MOD_NAME);
- ClientModConfiguration modconf(getClientModsLuaPath());
+ ModConfiguration modconf;
+ {
+ std::unordered_map<std::string, std::string> paths;
+ std::string path_user = porting::path_user + DIR_DELIM + "clientmods";
+ const auto modsPath = getClientModsLuaPath();
+ if (modsPath != path_user) {
+ paths["share"] = modsPath;
+ }
+ paths["mods"] = path_user;
+
+ std::string settings_path = path_user + DIR_DELIM + "mods.conf";
+ modconf.addModsFromConfig(settings_path, paths);
+ modconf.checkConflictsAndDeps();
+ }
+
m_mods = modconf.getMods();
// complain about mods with unsatisfied dependencies
if (!modconf.isConsistent()) {