From 4197f2777e10b8514e40166dcaad7182fdf983a2 Mon Sep 17 00:00:00 2001 From: Chris Beck Date: Sun, 15 Mar 2015 02:32:42 -0400 Subject: [PATCH] respect the "require_era" type fields for scenario add-on deps 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. --- src/saved_game.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/saved_game.cpp b/src/saved_game.cpp index f4663a7b9df2..e9aa47395869 100644 --- a/src/saved_game.cpp +++ b/src/saved_game.cpp @@ -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);