Avoid an assertion failure triggered in the replays.

This commit is contained in:
Mark de Wever 2007-12-24 22:17:20 +00:00
parent 7690221e3e
commit e171ebfa40
2 changed files with 9 additions and 1 deletions

View file

@ -57,6 +57,7 @@ Version 1.3.12+svn:
* loading a content with invalid wml does not terminate the game
* increased the precission off the mouse in the top row of the editor
(closes bug #10219)
* Avoid an assertion failure triggered in the replays
Version 1.3.12:
* campaigns:

View file

@ -284,7 +284,14 @@ void replay_controller::play_turn(){
(!recorder.at_end())){
play_side(player_number_ - 1, false);
play_slice();
// NOTE play_side increased player_number_ so play_slice can start with
// a player number which is an invalid team. The other question is why
// do we send the player number to play_side if it has access to it.
// If player_number_ > teams_.size() we will later trigger the assert in
// play_controller::current_team().
if(static_cast<size_t>(player_number_) <= teams_.size()) {
play_slice();
}
}
player_number_ = 1;