Skip to content

Commit

Permalink
sync "time over" event
Browse files Browse the repository at this point in the history
this makes random number generation and user choices during the time
over event synced.
  • Loading branch information
gfgtdf committed Mar 1, 2015
1 parent 341c31a commit 8c0bc92
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/playsingle_controller.cpp
Expand Up @@ -828,6 +828,7 @@ possible_end_play_signal playsingle_controller::check_time_over(){
if(!time_left) {
//FIXME: This should run in a synced context.
LOG_NG << "firing time over event...\n";
set_scontext_synced_base sync;
pump().fire("time over");
LOG_NG << "done firing time over event...\n";
//if turns are added while handling 'time over' event
Expand Down
1 change: 1 addition & 0 deletions src/replay_controller.cpp
Expand Up @@ -577,6 +577,7 @@ possible_end_play_signal replay_controller::play_move_or_side(bool one_move) {
finish_turn();
bool is_time_left = gamestate_.tod_manager_.next_turn(*resources::gamedata);
if(!is_time_left) {
set_scontext_synced_base sync;
pump().fire("time over");
}
it_is_a_new_turn_ = true;
Expand Down

0 comments on commit 8c0bc92

Please sign in to comment.