Make start-of-scenario saved games work again...

...(fix a regression from 2008-12-10T15:22:02Z!shadowm@wesnoth.org).
This commit is contained in:
Ignacio R. Morelle 2008-12-12 04:48:06 +00:00
parent 99861fae07
commit 1324720a32

View file

@ -536,10 +536,12 @@ game_state::game_state(const config& cfg, bool show_replay) :
//We therefore put it inside the starting_pos, so it doesn't get lost.
//See also playcampaign::play_game, where after finishing the scenario the replay
//will be saved.
config::child_list player_list = cfg.get_children("player");
for (config::child_list::const_iterator p = player_list.begin(); p != player_list.end(); p++){
config& cfg_player = starting_pos.add_child("player");
cfg_player.merge_with(**p);
if(!starting_pos.empty()) {
config::child_list player_list = cfg.get_children("player");
for (config::child_list::const_iterator p = player_list.begin(); p != player_list.end(); p++){
config& cfg_player = starting_pos.add_child("player");
cfg_player.merge_with(**p);
}
}
}