summaryrefslogtreecommitdiff
path: root/navit/route.c
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2013-05-05 20:07:02 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2013-05-05 20:07:02 +0000
commit661c73983ea17ea3e551bc80c9f019aeeff9da1b (patch)
tree20f03fd5618494fe4da76b7fa64827a6a07bfcf7 /navit/route.c
parent6179fe3830f1c7a13294d29e33aa5bbc7b1db3f5 (diff)
downloadnavit-661c73983ea17ea3e551bc80c9f019aeeff9da1b.tar.gz
Fix:Core:Count all paths for destination time/length
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@5487 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/route.c')
-rw-r--r--navit/route.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/navit/route.c b/navit/route.c
index 63bb3f2a0..8c4fcb145 100644
--- a/navit/route.c
+++ b/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: