move "move survivors to recall" code play_controller -> game_board

Added at "all_survivors_to_recall" function
This commit is contained in:
Chris Beck 2014-06-08 22:34:51 -04:00
parent 3c54dd63c8
commit 18dabe47c4
3 changed files with 14 additions and 8 deletions

View file

@ -51,6 +51,16 @@ void game_board::set_all_units_user_end_turn() {
}
}
void game_board::all_survivors_to_recall() {
BOOST_FOREACH (unit & un, units_) {
if (teams_[un.side() - 1].persistent()) {
un.new_turn();
un.new_scenario();
teams_[un.side() - 1].recall_list().push_back(un);
}
}
}
unit_map::iterator game_board::find_visible_unit(const map_location &loc,
const team& current_team, bool see_all)
{

View file

@ -100,6 +100,8 @@ class game_board {
void end_turn(int pnum);
void set_all_units_user_end_turn();
void all_survivors_to_recall();
// Manipulator from playturn
void side_drop_to (int side_num, team::CONTROLLER ctrl);

View file

@ -565,14 +565,8 @@ LEVEL_RESULT playsingle_controller::play_scenario(
// Add all the units that survived the scenario.
LOG_NG << "Add units that survived the scenario to the recall list.\n";
BOOST_FOREACH (unit & un, gameboard_.units_) {
if (gameboard_.teams_[un.side() - 1].persistent()) {
LOG_NG << "Added unit " << un.id() << ", " << un.name() << "\n";
un.new_turn();
un.new_scenario();
gameboard_.teams_[un.side() - 1].recall_list().push_back(un);
}
}
gameboard_.all_survivors_to_recall();
gamestate_.snapshot = config();
if(!is_observer()) {
persist_.end_transaction();