patch#707 (partial)

- prevent accessing an invalidated iterator when removing enemy
  healers from potential healers (thanks silene)
This commit is contained in:
Patrick Parker 2007-03-30 03:50:48 +00:00
parent 447af1ce11
commit 2b72b674c7

View File

@ -1348,7 +1348,7 @@ void calculate_healing(display& disp, const gamemap& map,
unit_map::iterator potential_healer = units.find(h_it->second);
wassert(potential_healer != units.end());
if(teams[potential_healer->second.side()-1].is_enemy(side)) {
heal.cfgs.erase(h_it);
h_it = heal.cfgs.erase(h_it);
} else {
++h_it;
}