Skip to content

Commit 4e5a459

Browse files
committedJul 15, 2013
Remove support for common mods
1 parent 112dbba commit 4e5a459

File tree

1 file changed

+0
-50
lines changed

1 file changed

+0
-50
lines changed
 

‎src/mods.cpp

-50
Original file line numberDiff line numberDiff line change
@@ -114,26 +114,6 @@ std::map<std::string, ModSpec> getModsInPath(std::string path, bool part_of_modp
114114
return result;
115115
}
116116

117-
ModSpec findCommonMod(const std::string &modname)
118-
{
119-
// Try to find in {$user,$share}/games/common/$modname
120-
std::vector<std::string> find_paths;
121-
find_paths.push_back(porting::path_user + DIR_DELIM + "games" +
122-
DIR_DELIM + "common" + DIR_DELIM + "mods" + DIR_DELIM + modname);
123-
find_paths.push_back(porting::path_share + DIR_DELIM + "games" +
124-
DIR_DELIM + "common" + DIR_DELIM + "mods" + DIR_DELIM + modname);
125-
for(u32 i=0; i<find_paths.size(); i++){
126-
const std::string &try_path = find_paths[i];
127-
if(fs::PathExists(try_path)){
128-
ModSpec spec(modname, try_path);
129-
parseModContents(spec);
130-
return spec;
131-
}
132-
}
133-
// Failed to find mod
134-
return ModSpec();
135-
}
136-
137117
std::map<std::string, ModSpec> flattenModTree(std::map<std::string, ModSpec> mods)
138118
{
139119
std::map<std::string, ModSpec> result;
@@ -182,36 +162,6 @@ ModConfiguration::ModConfiguration(std::string worldpath)
182162
{
183163
SubgameSpec gamespec = findWorldSubgame(worldpath);
184164

185-
// Add common mods
186-
std::map<std::string, ModSpec> common_mods;
187-
std::vector<std::string> inexistent_common_mods;
188-
Settings gameconf;
189-
if(getGameConfig(gamespec.path, gameconf)){
190-
if(gameconf.exists("common_mods")){
191-
Strfnd f(gameconf.get("common_mods"));
192-
while(!f.atend()){
193-
std::string modname = trim(f.next(","));
194-
if(modname.empty())
195-
continue;
196-
ModSpec spec = findCommonMod(modname);
197-
if(spec.name.empty())
198-
inexistent_common_mods.push_back(modname);
199-
else
200-
common_mods.insert(std::make_pair(modname, spec));
201-
}
202-
}
203-
}
204-
if(!inexistent_common_mods.empty()){
205-
std::string s = "Required common mods ";
206-
for(u32 i=0; i<inexistent_common_mods.size(); i++){
207-
if(i != 0) s += ", ";
208-
s += std::string("\"") + inexistent_common_mods[i] + "\"";
209-
}
210-
s += " could not be found.";
211-
throw ModError(s);
212-
}
213-
addMods(flattenMods(common_mods));
214-
215165
// Add all game mods and all world mods
216166
addModsInPath(gamespec.gamemods_path);
217167
addModsInPath(worldpath + DIR_DELIM + "worldmods");

0 commit comments

Comments
 (0)
Please sign in to comment.