sync "time over" event

this makes random number generation and user choices during the time
over event synced.
This commit is contained in:
gfgtdf 2015-03-01 17:48:29 +01:00
parent 341c31a6b9
commit 8c0bc92f38
2 changed files with 2 additions and 0 deletions

View file

@ -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

View file

@ -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;