diff options
author | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2009-07-27 11:10:05 +0000 |
---|---|---|
committer | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2009-07-27 11:10:05 +0000 |
commit | 40a45db535c52a5db289baa130b75a3d9f255edb (patch) | |
tree | 01e4e62b62b0462988bfe23802ab19e1166ce0b8 | |
parent | b5217d3700a3a8901d53ad784e53324b4d19d2cf (diff) | |
download | navit-svn-40a45db535c52a5db289baa130b75a3d9f255edb.tar.gz |
Fix:Core:Correct handling of vehicle profile change
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit/navit@2413 ffa7fe5e-494d-0410-b361-a75ebd5db220
-rw-r--r-- | navit.c | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -1545,6 +1545,9 @@ navit_set_attr_do(struct navit *this_, struct attr *attr, int init) int dir=0, orient_old=0, attr_updated=0; struct coord co; long zoom; + GList *l; + struct navit_vehicle *nv; + struct attr active=(struct attr){attr_active,{(void *)0}}; switch (attr->type) { case attr_autozoom: @@ -1638,23 +1641,20 @@ navit_set_attr_do(struct navit *this_, struct attr *attr, int init) this_->use_mousewheel=!!attr->u.num; break; case attr_vehicle: - if (!this_->vehicle || this_->vehicle->vehicle != attr->u.vehicle) { - GList *l; - struct navit_vehicle *nv; - struct attr active=(struct attr){attr_active,{(void *)0}}; - l=this_->vehicles; - while(l) { - nv=l->data; - if (nv->vehicle == attr->u.vehicle) { + l=this_->vehicles; + while(l) { + nv=l->data; + if (nv->vehicle == attr->u.vehicle) { + if (!this_->vehicle || this_->vehicle->vehicle != attr->u.vehicle) { if (this_->vehicle) vehicle_set_attr(this_->vehicle->vehicle, &active, NULL); active.u.num=1; vehicle_set_attr(nv->vehicle, &active, NULL); - navit_set_vehicle(this_, nv); attr_updated=1; } - l=g_list_next(l); + navit_set_vehicle(this_, nv); } + l=g_list_next(l); } break; case attr_zoom: |