Merge pull request #10541 from osmandapp/T8652

Add condition for 0 planRoadDirection
This commit is contained in:
vshcherb 2021-01-07 20:32:38 +01:00 committed by GitHub
commit 9673a14c0a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -533,16 +533,19 @@ public class BinaryRoutePlanner {
long fid = to.getRoad().getId();
for (int i = 0; i < from.getRoad().getRestrictionLength(); i++) {
long id = from.getRoad().getRestrictionId(i);
int tp = from.getRoad().getRestrictionType(i);
if (fid == id) {
int tp = from.getRoad().getRestrictionType(i);
if (tp == MapRenderingTypes.RESTRICTION_NO_LEFT_TURN ||
tp == MapRenderingTypes.RESTRICTION_NO_RIGHT_TURN ||
tp == MapRenderingTypes.RESTRICTION_NO_STRAIGHT_ON ||
tp == MapRenderingTypes.RESTRICTION_NO_U_TURN) {
if (tp == MapRenderingTypes.RESTRICTION_NO_LEFT_TURN
|| tp == MapRenderingTypes.RESTRICTION_NO_RIGHT_TURN
|| tp == MapRenderingTypes.RESTRICTION_NO_STRAIGHT_ON
|| tp == MapRenderingTypes.RESTRICTION_NO_U_TURN) {
return false;
}
break;
}
if (tp == MapRenderingTypes.RESTRICTION_ONLY_STRAIGHT_ON) {
return false;
}
}
}
return true;