mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-13 12:47:26 +00:00
patch#707 (partial)
- prevent accessing an invalidated iterator when removing enemy healers from potential healers (thanks silene)
This commit is contained in:
parent
447af1ce11
commit
2b72b674c7
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user