Skip to content

Commit

Permalink
respect the "require_era" type fields for scenario add-on deps
Browse files Browse the repository at this point in the history
This is needed for these fields to work properly, that is, to
allow hosting and joining a game without the clients needing to
download an add-on.
  • Loading branch information
cbeck88 committed Mar 15, 2015
1 parent bf06585 commit 4197f27
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/saved_game.cpp
Expand Up @@ -242,8 +242,9 @@ void saved_game::expand_mp_events()
if(const config& cfg = game_config_manager::get()->
game_config().find_child(mod.type, "id", mod.id))
{
// Note the addon_id
if (cfg.has_attribute("addon_id") && !cfg["addon_id"].empty()) {
// Note the addon_id if this mod is required to play the game in mp
std::string require_attr = "require_" + mod.type;
if (cfg.has_attribute("addon_id") && !cfg["addon_id"].empty() && cfg[require_attr].to_bool(true)) {
config addon_data = config_of("id",cfg["addon_id"])("version", cfg["addon_version"])("min_version", cfg["addon_min_version"]);
mp_game_settings::addon_version_info new_data(addon_data);

Expand Down

0 comments on commit 4197f27

Please sign in to comment.