}
+static int
+is_way_allowed(struct navigation_way *way)
+{
+ if (way->dir > 0) {
+ if (way->flags & AF_ONEWAYREV)
+ return 0;
+ } else {
+ if (way->flags & AF_ONEWAY)
+ return 0;
+ }
+ return 1;
+}
+
/**
* @brief Checks if navit has to create a maneuver to drive from old to new
*
wcat=maneuver_category(w->item.type);
/* If any other street has the same name but isn't a highway (a highway might split up temporarily), then
we can't use the same name criterium */
- if (is_same_street && is_same_street2(old->name1, old->name2, w->name1, w->name2) && (cat != 7 || wcat != 7))
+ if (is_same_street && is_same_street2(old->name1, old->name2, w->name1, w->name2) && (cat != 7 || wcat != 7) && is_way_allowed(w))
is_same_street=0;
/* Mark if the street has a higher or the same category */
if (wcat > maxcat)
last_itm=itm;
itm=itm->next;
}
+ command_new(this_, last_itm, 0);
}
static int
}
if (cmd->itm->prev->flags & AF_ROUNDABOUT) {
- if (level > 0) {
+ switch (level) {
+ case 2:
+ return g_strdup(_("Enter the roundabout soon"));
+ case 1:
d = get_distance(distance, type, 1);
ret = g_strdup_printf(_("In %s, enter the roundabout"), d);
g_free(d);
return ret;
- } else {
+ case 0:
cur = cmd->itm->prev;
count_roundabout = 0;
while (cur && (cur->flags & AF_ROUNDABOUT)) {
}
cur = cur->prev;
}
-
ret = g_strdup_printf(_("Leave the roundabout at the %s exit"), get_count_str(count_roundabout));
return ret;
}
static void
navigation_call_callbacks(struct navigation *this_, int force_speech)
{
- int distance, level = 0;
+ int distance, level = 0, level2;
void *p=this_;
if (!this_->cmd_first)
return;
} else if (!this_->turn_around_limit || this_->turn_around == -this_->turn_around_limit+1) {
this_->distance_turn=50;
level=navigation_get_announce_level(this_, this_->first->item.type, distance);
+ if (this_->cmd_first->itm->prev) {
+ level2=navigation_get_announce_level(this_, this_->cmd_first->itm->prev->item.type, distance);
+ if (level2 > level)
+ level=level2;
+ }
if (level < this_->level_last) {
dbg(1,"level %d < %d\n", level, this_->level_last);
this_->level_last=level;
if (map)
mr=map_rect_new(map, NULL);
if (mr) {
- while ((item=map_rect_get_item(mr)) && item->type == type_nav_position);
+ while ((item=map_rect_get_item(mr)) && (item->type == type_nav_position || item->type == type_nav_none));
if (item && item_attr_get(item, attr_navigation_speech, &attr)) {
speech_say(this_->speech, attr.u.str);
navit_textfile_debug_log(this_, "type=announcement label=\"%s\"", attr.u.str);
mr = map_rect_new(map, NULL);
if (mr)
while ((item = map_rect_get_item(mr))
- && item->type == type_nav_position);
+ && (item->type == type_nav_position || item->type == type_nav_none));
if (item) {
if (item_attr_get(item, attr_length, &attr)) {
mr = map_rect_new(map, NULL);
if (mr)
while ((item = map_rect_get_item(mr))
- && item->type == type_nav_position);
+ && (item->type == type_nav_position || item->type == type_nav_none));
if (item && item->type != type_nav_destination) {
name = item_to_name(item->type);
/* We check if the route graph segment is part of a roundabout here, because this
* only matters for route graph segments which form parts of the route path */
if (!(rgs->flags & AF_ROUNDABOUT)) { // We identified this roundabout earlier
- route_check_roundabout(rgs, 5, (dir < 1), NULL);
+ route_check_roundabout(rgs, 10, (dir < 1), NULL);
}
segment->item=rgs->item;