diff options
author | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2013-05-05 20:07:02 +0000 |
---|---|---|
committer | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2013-05-05 20:07:02 +0000 |
commit | 5d953d346a261f689935f92bdda9d5c267eea4e5 (patch) | |
tree | d713717f189d05fa951aefb27e820ca1d6107a60 | |
parent | c1791fcd225971ae08492b319322be2ac81fac89 (diff) | |
download | navit-5d953d346a261f689935f92bdda9d5c267eea4e5.tar.gz |
Fix:Core:Count all paths for destination time/length
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@5487 ffa7fe5e-494d-0410-b361-a75ebd5db220
-rw-r--r-- | navit/navit/route.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/navit/navit/route.c b/navit/navit/route.c index 63bb3f2a0..8c4fcb145 100644 --- a/navit/navit/route.c +++ b/navit/navit/route.c @@ -3881,17 +3881,25 @@ route_get_attr(struct route *this_, enum attr_type type, struct attr *attr, stru break; case attr_destination_time: if (this_->path2 && (this_->route_status == route_status_path_done_new || this_->route_status == route_status_path_done_incremental)) { - - attr->u.num=this_->path2->path_time; + struct route_path *path=this_->path2; + attr->u.num=0; + while (path) { + attr->u.num+=path->path_time; + path=path->next; + } dbg(1,"path_time %d\n",attr->u.num); - } - else + } else ret=0; break; case attr_destination_length: - if (this_->path2 && (this_->route_status == route_status_path_done_new || this_->route_status == route_status_path_done_incremental)) - attr->u.num=this_->path2->path_len; - else + if (this_->path2 && (this_->route_status == route_status_path_done_new || this_->route_status == route_status_path_done_incremental)) { + struct route_path *path=this_->path2; + attr->u.num=0; + while (path) { + attr->u.num+=path->path_len; + path=path->next; + } + } else ret=0; break; default: |