Fixed segfault in ai grouping in the case that path length was <2
This commit is contained in:
parent
c221e1b5d0
commit
278d80eb95
1 changed files with 1 additions and 1 deletions
|
@ -702,7 +702,7 @@ std::pair<map_location,map_location> ai::choose_move(std::vector<target>& target
|
|||
const double threat = power_projection(*i,enemy_dstsrc);
|
||||
//FIXME: sukko doubled the power-projection them in the second test. ?
|
||||
if((threat >= double(best->second.hitpoints()) && threat > power_projection(*i,fullmove_dstsrc)) ||
|
||||
(i >= best_route.steps.end()-2 && unit_at_target != units_.end() && current_team().is_enemy(unit_at_target->second.side()))) {
|
||||
(i+1 >= best_route.steps.end()-1 && unit_at_target != units_.end() && current_team().is_enemy(unit_at_target->second.side()))) {
|
||||
dangerous = true;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue