fixed error in move_leader_to_keep part of testing_ai_default,
...will get rid of wrong moves being considered, which were reported by 'move_leader_to_keep failed!' messages
This commit is contained in:
parent
9ac85e36d7
commit
e4d2f51207
1 changed files with 5 additions and 3 deletions
|
@ -755,9 +755,11 @@ double move_leader_to_keep_phase::evaluate()
|
|||
const int current_distance = distance_between(leader->first,keep);
|
||||
foreach (const paths::step &dest, leader_paths.destinations)
|
||||
{
|
||||
const int new_distance = distance_between(dest.curr,keep);
|
||||
if(new_distance < current_distance) {
|
||||
moves_toward_keep.insert(std::make_pair(new_distance, dest.curr));
|
||||
if (!units_.find(dest.curr).valid()){
|
||||
const int new_distance = distance_between(dest.curr,keep);
|
||||
if(new_distance < current_distance) {
|
||||
moves_toward_keep.insert(std::make_pair(new_distance, dest.curr));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue