partial fix for bbug #10354:
loading linger mode savegame where the enemy leader is back with 0 or less HP
This commit is contained in:
parent
b66c824442
commit
2f7870feef
1 changed files with 11 additions and 0 deletions
|
@ -2162,6 +2162,17 @@ bool event_handler::handle_event_command(const queued_event& event_info,
|
|||
}
|
||||
|
||||
else if(cmd == "endlevel") {
|
||||
//remove 0-hp units from the unit map
|
||||
unit_map::iterator u = units->begin();
|
||||
while(u != units->end()) {
|
||||
if(u->second.hitpoints() <= 0) {
|
||||
units->erase(u++);
|
||||
++unit_mutations;
|
||||
} else {
|
||||
++u;
|
||||
}
|
||||
}
|
||||
|
||||
const std::string next_scenario = cfg["next_scenario"];
|
||||
if(next_scenario.empty() == false) {
|
||||
state_of_game->scenario = next_scenario;
|
||||
|
|
Loading…
Add table
Reference in a new issue