diff --git a/src/ai/testing/stage_sf_with_rca.cpp b/src/ai/testing/stage_sf_with_rca.cpp index 577e0caa17e3..28e5afce1143 100644 --- a/src/ai/testing/stage_sf_with_rca.cpp +++ b/src/ai/testing/stage_sf_with_rca.cpp @@ -278,7 +278,7 @@ void strategy_formulation_with_rca::switch_side() else this->set_side(1); - resources::tod_manager->next_turn(*resources::gamedata); + resources::tod_manager->next_turn(resources::gamedata); DBG_AI_TESTING_SF_WITH_RCA << "switch to turn " << resources::tod_manager->turn() << std::endl; DBG_AI_TESTING_SF_WITH_RCA << "------switch_side() end------" << std::endl; diff --git a/src/game_events/action_wml.cpp b/src/game_events/action_wml.cpp index f2df28f9618c..c442f02df907 100644 --- a/src/game_events/action_wml.cpp +++ b/src/game_events/action_wml.cpp @@ -409,7 +409,7 @@ WML_HANDLER_FUNCTION(modify_turns, /*event_info*/, cfg) if(new_turn_number_u < 1 || (new_turn_number > tod_man.number_of_turns() && tod_man.number_of_turns() != -1)) { ERR_NG << "attempted to change current turn number to one out of range (" << new_turn_number << ")" << std::endl; } else if(new_turn_number_u != current_turn_number) { - tod_man.set_turn_by_wml(new_turn_number_u, *resources::gamedata); + tod_man.set_turn_by_wml(new_turn_number_u, resources::gamedata); resources::screen->new_turn(); } } diff --git a/src/play_controller.cpp b/src/play_controller.cpp index 826d1772bd86..d3623f296fea 100644 --- a/src/play_controller.cpp +++ b/src/play_controller.cpp @@ -1234,7 +1234,7 @@ void play_controller::play_turn() void play_controller::check_time_over() { - const bool time_left = gamestate().tod_manager_.next_turn(gamestate().gamedata_); + const bool time_left = gamestate().tod_manager_.next_turn(&gamestate().gamedata_); if(!time_left) { LOG_NG << "firing time over event...\n"; diff --git a/src/synced_commands.cpp b/src/synced_commands.cpp index cd05580f8231..7ca061cd9925 100644 --- a/src/synced_commands.cpp +++ b/src/synced_commands.cpp @@ -549,7 +549,7 @@ SYNCED_COMMAND_HANDLER_FUNCTION(debug_turn, child, use_undo, /*show*/, /*error_h debug_notification(":turn debug command was used during turn of $player"); - resources::tod_manager->set_turn(child["turn"].to_int(1), *resources::gamedata); + resources::tod_manager->set_turn(child["turn"].to_int(1), resources::gamedata); resources::screen->new_turn(); resources::screen->redraw_everything(); diff --git a/src/tod_manager.cpp b/src/tod_manager.cpp index 8420daf019f4..356313f2d41b 100644 --- a/src/tod_manager.cpp +++ b/src/tod_manager.cpp @@ -410,7 +410,7 @@ void tod_manager::set_number_of_turns_by_wml(int num) update_server_information(); } -void tod_manager::set_turn(const int num, boost::optional vars, const bool increase_limit_if_needed) +void tod_manager::set_turn(const int num, game_data* vars, const bool increase_limit_if_needed) { const int new_turn = std::max(num, 1); LOG_NG << "changing current turn number from " << turn_ << " to " << new_turn << '\n'; @@ -425,7 +425,7 @@ void tod_manager::set_turn(const int num, boost::optional vars, con vars->get_variable("turn_number") = new_turn; } -void tod_manager::set_turn_by_wml(const int num, boost::optional vars, const bool increase_limit_if_needed) +void tod_manager::set_turn_by_wml(const int num, game_data* vars, const bool increase_limit_if_needed) { set_turn(num, vars, increase_limit_if_needed); update_server_information(); @@ -455,7 +455,7 @@ int tod_manager::calculate_current_time( return new_current_time; } -bool tod_manager::next_turn(boost::optional vars) +bool tod_manager::next_turn(game_data* vars) { set_turn(turn_ + 1, vars, false); has_turn_event_fired_ = false; diff --git a/src/tod_manager.hpp b/src/tod_manager.hpp index 680d870ee555..f9dca3133493 100644 --- a/src/tod_manager.hpp +++ b/src/tod_manager.hpp @@ -163,16 +163,16 @@ class tod_manager : public savegame::savegame_config void set_number_of_turns_by_wml(int num); /** Dynamically change the current turn number. */ - void set_turn(const int num, boost::optional vars = boost::none, const bool increase_limit_if_needed = true); + void set_turn(const int num, game_data* vars = NULL, const bool increase_limit_if_needed = true); /** Dynamically change the current turn number. */ - void set_turn_by_wml(const int num, boost::optional vars = boost::none, const bool increase_limit_if_needed = true); + void set_turn_by_wml(const int num, game_data* vars = NULL, const bool increase_limit_if_needed = true); /** * Function to move to the next turn. * * @returns True if time has not expired. */ - bool next_turn(boost::optional vars); + bool next_turn(game_data* vars); /** * Function to check the end of turns.