fixed error in move_leader_to_keep part of 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
80626b67f5
commit
9ac85e36d7
1 changed files with 6 additions and 4 deletions
|
@ -746,10 +746,12 @@ void ai_default::move_leader_to_keep()
|
|||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Find the first location which we can move to,
|
||||
|
|
Loading…
Add table
Reference in a new issue