fixes bug #6142 (random variables aren't saved with a replay

This commit is contained in:
Jörg Hinrichs 2006-07-21 16:39:08 +00:00
parent 7b6bbd63c3
commit 145dcc8bb0
2 changed files with 4 additions and 11 deletions

View file

@ -521,17 +521,8 @@ config* replay::get_next_action()
void replay::pre_replay()
{
while(pos_ < commands().size()) {
if (commands()[pos_]->child("start") != NULL){
if(get_next_action() == NULL)
return;
}
else{
//This should not happen under normal circumstances and makes sure the
//rng is initialized even if there is no start-tag
set_random(commands()[pos_]);
break;
}
if ((rng::random() == NULL) && (commands().size() > 0)){
set_random(commands()[pos_]);
}
}

View file

@ -154,6 +154,8 @@ void replay_controller::reset_replay(){
events_manager_ = new game_events::manager(level_,*gui_,map_,units_,teams_,
gamestate_,status_,gameinfo_);
}
fire_prestart(true);
fire_start(!loading_game_);
(*gui_).invalidate_all();
(*gui_).draw();
}