From 59947ae969f64157ab5d559ea8f3b96822c685c4 Mon Sep 17 00:00:00 2001 From: gfgtdf Date: Thu, 27 Jul 2017 15:53:58 +0200 Subject: [PATCH] fix units with high mp beeing able to step over unreachable --- src/pathfind/pathfind.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pathfind/pathfind.cpp b/src/pathfind/pathfind.cpp index a103814159b..77a2477313f 100644 --- a/src/pathfind/pathfind.cpp +++ b/src/pathfind/pathfind.cpp @@ -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(); }