Skip to content

Commit

Permalink
Fixed assertion in replays with all AI sides (bug #24439)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vultraz committed Feb 28, 2016
1 parent e9fc60f commit ddb873d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/game_state.hpp
Expand Up @@ -70,6 +70,7 @@ class game_state : public filter_context
game_events::wmi_container& get_wml_menu_items();
const game_events::wmi_container& get_wml_menu_items() const;
int first_human_team_; //needed to initialize the viewpoint during setup
const bool has_human_sides() const { return first_human_team_ != -1; }

game_state(const config & level, play_controller &, const tdata_cache & tdata);
/// The third parameter is an optimisation.
Expand Down
2 changes: 1 addition & 1 deletion src/playsingle_controller.cpp
Expand Up @@ -670,7 +670,7 @@ void playsingle_controller::reset_replay()

void playsingle_controller::enable_replay(bool is_unit_test)
{
mp_replay_.reset(new replay_controller(*this, true, boost::shared_ptr<config>( new config(saved_game_.replay_start())), boost::bind(&playsingle_controller::on_replay_end, this, is_unit_test)));
mp_replay_.reset(new replay_controller(*this, gamestate().has_human_sides(), boost::shared_ptr<config>( new config(saved_game_.replay_start())), boost::bind(&playsingle_controller::on_replay_end, this, is_unit_test)));
if(is_unit_test) {
mp_replay_->play_replay();
}
Expand Down

0 comments on commit ddb873d

Please sign in to comment.