fix 21866

This commit is contained in:
gfgtdf 2014-04-16 19:08:37 +02:00
parent 65f1d5dff8
commit 7ee5a2e074
2 changed files with 6 additions and 2 deletions

View file

@ -72,8 +72,10 @@ config initial_level_config(game_display& disp, const mp_game_settings& params,
// Convert options to events
level.add_child_at("event", options::to_event(params.options.find_child(
"multiplayer", "id", params.mp_scenario)), 0);
level["next_underlying_unit_id"] = 0;
if(!level.has_attribute("next_underlying_unit_id"))
{
level["next_underlying_unit_id"] = 0;
}
n_unit::id_manager::instance().clear();
if (params.random_start_time)

View file

@ -40,6 +40,7 @@
#include "savegame.hpp"
#include "sound.hpp"
#include "wml_exception.hpp"
#include "unit_id.hpp"
#include "formula_string_utils.hpp"
#include <boost/foreach.hpp>
@ -629,6 +630,7 @@ LEVEL_RESULT play_game(game_display& disp, game_state& gamestate,
}
params.scenario_data = *scenario;
params.scenario_data["next_underlying_unit_id"] = n_unit::id_manager::instance().get_save_id();
params.mp_scenario = (*scenario)["id"].str();
params.mp_scenario_name = (*scenario)["name"].str();
params.num_turns = (*scenario)["turns"].to_int(-1);