heal units on recall list at scenario end
more importantly, it also removes objects with duration=scenario
This commit is contained in:
parent
6921fe1bb8
commit
74c2398f67
1 changed files with 14 additions and 5 deletions
|
@ -84,13 +84,22 @@ void game_board::set_all_units_user_end_turn() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void game_board::heal_all_survivors() {
|
void game_board::heal_all_survivors() {
|
||||||
for (unit_map::iterator it = units_.begin(); it != units_.end(); it++) {
|
for (auto& u : units_) {
|
||||||
unit_ptr un = it.get_shared_ptr();
|
if (get_team(u.side()).persistent()) {
|
||||||
if (teams_[un->side() - 1].persistent()) {
|
u.new_turn();
|
||||||
un->new_turn();
|
u.new_scenario();
|
||||||
un->new_scenario();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for(auto& t : teams_) {
|
||||||
|
if(t.persistent()) {
|
||||||
|
for(auto& up : t.recall_list()) {
|
||||||
|
up->new_scenario();
|
||||||
|
up->new_turn();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void game_board::check_victory(bool & continue_level, bool & found_player, bool & found_network_player, bool & cleared_villages, std::set<unsigned> & not_defeated, bool remove_from_carryover_on_defeat)
|
void game_board::check_victory(bool & continue_level, bool & found_player, bool & found_network_player, bool & cleared_villages, std::set<unsigned> & not_defeated, bool remove_from_carryover_on_defeat)
|
||||||
|
|
Loading…
Add table
Reference in a new issue