Fix AI ignoring teleport locations when moving leader to leader goals

(cherry-picked from commit 45674a3d79)
This commit is contained in:
Celtic Minstrel 2018-04-14 10:19:07 -04:00 committed by Celtic Minstrel
parent 5330405274
commit 39e7d69f9a

View file

@ -302,8 +302,9 @@ double move_leader_to_goals_phase::evaluate()
}
pathfind::shortest_path_calculator calc(*leader, current_team(), resources::gameboard->teams(), resources::gameboard->map());
const pathfind::teleport_map allowed_teleports = pathfind::get_teleport_locations(*leader, current_team());
pathfind::plain_route route = a_star_search(leader->get_location(), dst_, 1000.0, calc,
resources::gameboard->map().w(), resources::gameboard->map().h());
resources::gameboard->map().w(), resources::gameboard->map().h(), &allowed_teleports);
if(route.steps.empty()) {
LOG_AI_TESTING_AI_DEFAULT << "route empty";
return BAD_SCORE;