diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-11-27 13:03:54 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-11-29 19:13:55 +0200 |
commit | fd8b9a3a44cadc048a32e0a6189a59716c2432d1 (patch) | |
tree | 7756162028a8736f1af42a8909f0c5487af26a79 | |
parent | 5c1cb01936093fc7e57d4b6d7a170dff9a18cd7d (diff) | |
download | minetest-fd8b9a3a44cadc048a32e0a6189a59716c2432d1.tar.gz minetest-fd8b9a3a44cadc048a32e0a6189a59716c2432d1.tar.bz2 minetest-fd8b9a3a44cadc048a32e0a6189a59716c2432d1.zip |
Warn about unsatisfied dependencies
-rw-r--r-- | src/server.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/server.cpp b/src/server.cpp index 58611bed1..f3e497ff1 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -979,6 +979,7 @@ static core::list<ModSpec> getMods(core::list<std::string> &modspaths) mods_satisfied.push(spec); } } + // Sort by depencencies while(!mods_satisfied.empty()){ ModSpec mod = mods_satisfied.front(); mods_satisfied.pop(); @@ -994,6 +995,22 @@ static core::list<ModSpec> getMods(core::list<std::string> &modspaths) mods_satisfied.push(mod2); } } + // Check unsatisfied dependencies + for(core::list<ModSpec>::Iterator i = mods_unsorted.begin(); + i != mods_unsorted.end(); i++){ + ModSpec mod = *i; + if(mod.unsatisfied_depends.empty()) + continue; + errorstream<<"mod \""<<mod.name + <<"\" has unsatisfied dependencies:"; + for(std::set<std::string>::iterator + i = mod.unsatisfied_depends.begin(); + i != mod.unsatisfied_depends.end(); i++){ + errorstream<<" \""<<(*i)<<"\""; + } + errorstream<<". Loading nevertheless."<<std::endl; + mods_sorted.push_back(mod); + } return mods_sorted; } |