summaryrefslogtreecommitdiff
path: root/src/mods.cpp
diff options
context:
space:
mode:
authorPilzAdam <pilzadam@minetest.net>2013-06-06 23:46:03 +0000
committerPilzAdam <pilzadam@minetest.net>2013-07-16 01:46:59 +0200
commit4e5a45952a4f40511029de8f9340f59ad6d97c44 (patch)
tree8d8878a13a2fc854a16d3d98e7a669860f998922 /src/mods.cpp
parent112dbba7c4d38bf780e4e2f05bdff106b52ce2f9 (diff)
downloadminetest-4e5a45952a4f40511029de8f9340f59ad6d97c44.tar.gz
minetest-4e5a45952a4f40511029de8f9340f59ad6d97c44.tar.bz2
minetest-4e5a45952a4f40511029de8f9340f59ad6d97c44.zip
Remove support for common mods
Diffstat (limited to 'src/mods.cpp')
-rw-r--r--src/mods.cpp50
1 files changed, 0 insertions, 50 deletions
diff --git a/src/mods.cpp b/src/mods.cpp
index 75c2dd89c..bcdda01ef 100644
--- a/src/mods.cpp
+++ b/src/mods.cpp
@@ -114,26 +114,6 @@ std::map<std::string, ModSpec> getModsInPath(std::string path, bool part_of_modp
return result;
}
-ModSpec findCommonMod(const std::string &modname)
-{
- // Try to find in {$user,$share}/games/common/$modname
- std::vector<std::string> find_paths;
- find_paths.push_back(porting::path_user + DIR_DELIM + "games" +
- DIR_DELIM + "common" + DIR_DELIM + "mods" + DIR_DELIM + modname);
- find_paths.push_back(porting::path_share + DIR_DELIM + "games" +
- DIR_DELIM + "common" + DIR_DELIM + "mods" + DIR_DELIM + modname);
- for(u32 i=0; i<find_paths.size(); i++){
- const std::string &try_path = find_paths[i];
- if(fs::PathExists(try_path)){
- ModSpec spec(modname, try_path);
- parseModContents(spec);
- return spec;
- }
- }
- // Failed to find mod
- return ModSpec();
-}
-
std::map<std::string, ModSpec> flattenModTree(std::map<std::string, ModSpec> mods)
{
std::map<std::string, ModSpec> result;
@@ -182,36 +162,6 @@ ModConfiguration::ModConfiguration(std::string worldpath)
{
SubgameSpec gamespec = findWorldSubgame(worldpath);
- // Add common mods
- std::map<std::string, ModSpec> common_mods;
- std::vector<std::string> inexistent_common_mods;
- Settings gameconf;
- if(getGameConfig(gamespec.path, gameconf)){
- if(gameconf.exists("common_mods")){
- Strfnd f(gameconf.get("common_mods"));
- while(!f.atend()){
- std::string modname = trim(f.next(","));
- if(modname.empty())
- continue;
- ModSpec spec = findCommonMod(modname);
- if(spec.name.empty())
- inexistent_common_mods.push_back(modname);
- else
- common_mods.insert(std::make_pair(modname, spec));
- }
- }
- }
- if(!inexistent_common_mods.empty()){
- std::string s = "Required common mods ";
- for(u32 i=0; i<inexistent_common_mods.size(); i++){
- if(i != 0) s += ", ";
- s += std::string("\"") + inexistent_common_mods[i] + "\"";
- }
- s += " could not be found.";
- throw ModError(s);
- }
- addMods(flattenMods(common_mods));
-
// Add all game mods and all world mods
addModsInPath(gamespec.gamemods_path);
addModsInPath(worldpath + DIR_DELIM + "worldmods");