diff options
author | Jürgen Doser <jurgen.doser@gmail.com> | 2013-02-20 20:06:39 +0100 |
---|---|---|
committer | Jürgen Doser <jurgen.doser@gmail.com> | 2013-02-20 20:06:39 +0100 |
commit | 89b88917a89923b37b629557fdeb54fa0b442bb9 (patch) | |
tree | d6eae81f201f7e0598396f567296a978aa89d0f1 /src | |
parent | fc61c8809b9a1d47d9f117446764107a56cec956 (diff) | |
download | minetest-89b88917a89923b37b629557fdeb54fa0b442bb9.tar.gz minetest-89b88917a89923b37b629557fdeb54fa0b442bb9.tar.bz2 minetest-89b88917a89923b37b629557fdeb54fa0b442bb9.zip |
Print missing mod dependencies on server start
i.e., not only the mod with missing dependencies, but also the missing
dependencies itself. (This already used to be the case before the mod
selection gui was added)
Also, mods with unsatisfied dependencies are no longer reported as
mods that could not be found.
Diffstat (limited to 'src')
-rw-r--r-- | src/server.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/server.cpp b/src/server.cpp index 572ef4d82..ec8f8a5e8 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -998,17 +998,20 @@ Server::Server( ModConfiguration modconf(m_path_world); m_mods = modconf.getMods(); + std::list<ModSpec> unsatisfied_mods = modconf.getUnsatisfiedMods(); // complain about mods with unsatisfied dependencies if(!modconf.isConsistent()) { - errorstream << "The following mods have unsatisfied dependencies: "; - std::list<ModSpec> modlist = modconf.getUnsatisfiedMods(); - for(std::list<ModSpec>::iterator it = modlist.begin(); - it != modlist.end(); ++it) + for(std::list<ModSpec>::iterator it = unsatisfied_mods.begin(); + it != unsatisfied_mods.end(); ++it) { - errorstream << (*it).name << " "; + ModSpec mod = *it; + errorstream << "mod \"" << mod.name << "\" has unsatisfied dependencies: "; + for(std::set<std::string>::iterator dep_it = mod.unsatisfied_depends.begin(); + dep_it != mod.unsatisfied_depends.end(); ++dep_it) + errorstream << " \"" << *dep_it << "\""; + errorstream << std::endl; } - errorstream << std::endl; } Settings worldmt_settings; @@ -1033,12 +1036,15 @@ Server::Server( for(std::vector<ModSpec>::iterator it = m_mods.begin(); it != m_mods.end(); ++it) load_mod_names.erase((*it).name); + for(std::list<ModSpec>::iterator it = unsatisfied_mods.begin(); + it != unsatisfied_mods.end(); ++it) + load_mod_names.erase((*it).name); if(!load_mod_names.empty()) { - errorstream << "The following mods could not be found: "; + errorstream << "The following mods could not be found:"; for(std::set<std::string>::iterator it = load_mod_names.begin(); it != load_mod_names.end(); ++it) - errorstream << (*it) << " "; + errorstream << " \"" << (*it) << "\""; errorstream << std::endl; } |