add condition for 0 planRoadDirection

This commit is contained in:
Kseniia 2021-01-07 21:30:15 +02:00
parent 371e60b3af
commit 80f083cf3a

View file

@ -533,18 +533,17 @@ public class BinaryRoutePlanner {
long fid = to.getRoad().getId();
for (int i = 0; i < from.getRoad().getRestrictionLength(); i++) {
long id = from.getRoad().getRestrictionId(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 (fid == id) {
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 (from.getRoad().getRestrictionType(i) == MapRenderingTypes.RESTRICTION_ONLY_STRAIGHT_ON) {
if (tp == MapRenderingTypes.RESTRICTION_ONLY_STRAIGHT_ON) {
return false;
}
}