Fix:Core:Fixed vehicle switching
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Sun, 4 May 2008 16:52:42 +0000 (16:52 +0000)
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Sun, 4 May 2008 16:52:42 +0000 (16:52 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@1040 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/src/navit.c

index 3bb9527..f3efa04 100644 (file)
@@ -1193,12 +1193,12 @@ navit_set_attr(struct navit *this_, struct attr *attr)
                }
                break;
        case attr_vehicle:
-               if (this_->vehicle && this_->vehicle->vehicle != attr->u.vehicle) {
+               if (!this_->vehicle || this_->vehicle->vehicle != attr->u.vehicle) {
                        GList *l;
                        l=this_->vehicles;
                        while(l) {
                                if (((struct navit_vehicle *)l->data)->vehicle == attr->u.vehicle) {
-                                       this_->vehicle=(struct navit_vehicle *)l;
+                                       this_->vehicle=(struct navit_vehicle *)l->data;
                                        attr_updated=1;
                                }
                                l=g_list_next(l);