Change [scenario] tags to [multiplayer] if MP game is being loaded.
This commit is contained in:
parent
e07c69d5e5
commit
df2b37285c
2 changed files with 17 additions and 2 deletions
|
@ -130,6 +130,21 @@ void game_config_manager::load_game_config(FORCE_RELOAD_CONFIG force_reload)
|
|||
|
||||
load_addons_cfg();
|
||||
|
||||
// [scenario] tags should become [multiplayer] tags
|
||||
// if multiplayer game is being loaded.
|
||||
preproc_map defines_map = cache_.get_preproc_map();
|
||||
if (defines_map.find("MULTIPLAYER") != defines_map.end()) {
|
||||
const config::const_child_itors &ci =
|
||||
game_config().child_range("scenario");
|
||||
std::vector<config> scenarios(ci.first, ci.second);
|
||||
|
||||
game_config_.clear_children("scenario");
|
||||
|
||||
BOOST_FOREACH(const config& cfg, scenarios) {
|
||||
game_config_.add_child("multiplayer", cfg);
|
||||
}
|
||||
}
|
||||
|
||||
// Extract the Lua scripts at toplevel.
|
||||
extract_preload_scripts(game_config_);
|
||||
game_config_.clear_children("lua");
|
||||
|
|
|
@ -254,8 +254,8 @@ void create::process_event()
|
|||
resources::config_manager->
|
||||
load_game_config_for_game(state_.classification());
|
||||
|
||||
const config& level = game_config().find_child("scenario", "id",
|
||||
mp_level_.campaign["first_scenario"]);
|
||||
const config& level = game_config().find_child("multiplayer",
|
||||
"id", mp_level_.campaign["first_scenario"]);
|
||||
parameters_.scenario_data = level;
|
||||
|
||||
set_result(CREATE);
|
||||
|
|
Loading…
Add table
Reference in a new issue