Fixes broken replays after last savegame commits...

...by getting the starting position out of gamestate.starting_pos
instead of snapshot. Also fixes replays stumbling upon empty command
tags.
This commit is contained in:
Jörg Hinrichs 2007-01-15 20:13:47 +00:00
parent 48621210ac
commit e79aff40b6
2 changed files with 5 additions and 5 deletions

View file

@ -139,11 +139,10 @@ LEVEL_RESULT play_game(display& disp, game_state& gamestate, const config& game_
LOG_G << "scenario found: " << (scenario != NULL ? "yes" : "no") << "\n";
}
} else {
//This game was started from a savegame
LOG_G << "loading snapshot...\n";
//load from a save-snapshot.
starting_pos = gamestate.snapshot;
scenario = &starting_pos;
gamestate = read_game(units_data, &gamestate.snapshot);
starting_pos = gamestate.starting_pos;
scenario = &gamestate.snapshot;
}
controller_map controllers;

View file

@ -704,7 +704,8 @@ bool do_replay(display& disp, const gamemap& map, const game_data& gameinfo,
return false;
}
else if(cfg->child("start") != NULL) {
//if there is an empty command tag, create by pre_replay() or a start tag
else if ( (cfg->all_children().size() == 0) || (cfg->child("start") != NULL) ){
//do nothing
} else if((child = cfg->child("speak")) != NULL) {