mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-08 17:26:24 +00:00
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
@ -755,11 +755,13 @@ double move_leader_to_keep_phase::evaluate()
|
||||
const int current_distance = distance_between(leader->first,keep);
|
||||
foreach (const paths::step &dest, leader_paths.destinations)
|
||||
{
|
||||
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,
|
||||
// without the threat of enemies.
|
||||
|
Loading…
x
Reference in New Issue
Block a user