From eab60bed463ae7b5eb727ce9d693117346a4099e Mon Sep 17 00:00:00 2001 From: clementcontet Date: Tue, 16 Mar 2021 17:49:57 +0100 Subject: [PATCH] Compute obstaclesTime before adding final segment Fix https://github.com/osmandapp/OsmAnd/issues/10867 --- .../src/main/java/net/osmand/router/BinaryRoutePlanner.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/router/BinaryRoutePlanner.java b/OsmAnd-java/src/main/java/net/osmand/router/BinaryRoutePlanner.java index 0769e1390c..4c85058fa3 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/BinaryRoutePlanner.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/BinaryRoutePlanner.java @@ -457,10 +457,10 @@ public class BinaryRoutePlanner { directionAllowed = false; continue; } - boolean alreadyVisited = checkIfOppositeSegmentWasVisited(ctx, reverseWaySearch, graphSegments, segment, oppositeSegments, - segmentPoint, segmentDist, obstaclesTime); obstaclesTime += obstacle; obstaclesTime += heightObstacle; + boolean alreadyVisited = checkIfOppositeSegmentWasVisited(ctx, reverseWaySearch, graphSegments, segment, oppositeSegments, + segmentPoint, segmentDist, obstaclesTime); if (alreadyVisited) { directionAllowed = false; continue;