Skip to content

Commit

Permalink
Fix AI ignoring teleport locations when moving leader to leader goals
Browse files Browse the repository at this point in the history
Backport, closes #3347
  • Loading branch information
CelticMinstrel authored and sevu committed Jul 28, 2018
1 parent ed88bd9 commit abb754c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ai/default/ca.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit abb754c

Please sign in to comment.