fix unsynced sighted events at turn end.

now undo_stack_->clear(); which fires sighted events runs in a synced
context.
This commit is contained in:
gfgtdf 2015-02-26 19:38:23 +01:00
parent bc846c73ac
commit 5332fa8fc4
3 changed files with 4 additions and 10 deletions

View file

@ -499,14 +499,14 @@ void play_controller::finish_side_turn()
whiteboard_manager_->on_finish_side_turn(player_number_);
gamestate_.board_.end_turn(player_number_);
{ //Block for set_scontext_synced
set_scontext_synced sync(1);
// Ending the turn commits all moves.
undo_stack_->clear();
gamestate_.board_.end_turn(player_number_);
const std::string turn_num = str_cast(turn());
const std::string side_num = str_cast(player_number_);
set_scontext_synced sync(1);
// Clear shroud, in case units had been slowed for the turn.
actions::clear_shroud(player_number_);

View file

@ -624,8 +624,6 @@ possible_end_play_signal playsingle_controller::play_side()
}
}
// Ending the turn commits all moves.
undo_stack_->clear();
if ( !player_type_changed_ )
after_human_turn();
LOG_NG << "human finished turn...\n";

View file

@ -842,10 +842,6 @@ REPLAY_RETURN do_replay_handle(bool one_move)
}
else
{
// During the original game, the undo stack would have been
// committed at this point.
resources::undo_stack->clear();
if (const config &child = cfg->child("verify")) {
verify(*resources::units, child);
}