fix units with high mp beeing able to step over unreachable

This commit is contained in:
gfgtdf 2017-07-27 15:53:58 +02:00 committed by GitHub
parent ac063ce8e7
commit 59947ae969

View File

@ -716,7 +716,7 @@ double shortest_path_calculator::cost(const map_location& loc, const double so_f
remaining_movement = total_movement_ - (-remaining_movement) % total_movement_;
}
if (total_movement_ < terrain_cost && remaining_movement < terrain_cost) {
if (terrain_cost >= movetype::UNREACHABLE || (total_movement_ < terrain_cost && remaining_movement < terrain_cost)) {
return getNoPathValue();
}