Skip to content

Commit

Permalink
add type=sp/mp for [era] and [modification]
Browse files Browse the repository at this point in the history
This allows wmldevs to have their eras and modifications only available
in sp or only in mp. By default (if type=  is omitted) it is available
in both.
  • Loading branch information
gfgtdf committed Feb 2, 2015
1 parent 20b91d3 commit a882a83
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/game_initialization/create_engine.cpp
Expand Up @@ -1115,12 +1115,18 @@ void create_engine::init_extras(const MP_EXTRA extra_type)
BOOST_FOREACH(const config &extra,
game_config_manager::get()->game_config().child_range(extra_name)) {

extras_metadata_ptr new_extras_metadata(new extras_metadata());
new_extras_metadata->id = extra["id"].str();
new_extras_metadata->name = extra["name"].str();
new_extras_metadata->description = extra["description"].str();
const std::string& type = extra["type"];
bool mp = state_.classification().campaign_type == game_classification::MULTIPLAYER;

if((type != "mp" || mp) && (type != "sp" || !mp) )
{
extras_metadata_ptr new_extras_metadata(new extras_metadata());
new_extras_metadata->id = extra["id"].str();
new_extras_metadata->name = extra["name"].str();
new_extras_metadata->description = extra["description"].str();

extras.push_back(new_extras_metadata);
extras.push_back(new_extras_metadata);
}
}
}

Expand Down

0 comments on commit a882a83

Please sign in to comment.