@@ -114,26 +114,6 @@ std::map<std::string, ModSpec> getModsInPath(std::string path, bool part_of_modp
114
114
return result;
115
115
}
116
116
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
-
137
117
std::map<std::string, ModSpec> flattenModTree (std::map<std::string, ModSpec> mods)
138
118
{
139
119
std::map<std::string, ModSpec> result;
@@ -182,36 +162,6 @@ ModConfiguration::ModConfiguration(std::string worldpath)
182
162
{
183
163
SubgameSpec gamespec = findWorldSubgame (worldpath);
184
164
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
-
215
165
// Add all game mods and all world mods
216
166
addModsInPath (gamespec.gamemods_path );
217
167
addModsInPath (worldpath + DIR_DELIM + " worldmods" );
0 commit comments