if (navit_set_vehicleprofile(this_, attr.u.str))
return;
}
- navit_set_vehicleprofile(this_,"car");
+ if (!navit_set_vehicleprofile(this_,"car")) {
+ /* We do not have a fallback "car" profile
+ * so lets set any profile */
+ GList *l;
+ l=this_->vehicleprofiles;
+ if (l) {
+ this_->vehicleprofile=l->data;
+ if (this_->route)
+ route_set_profile(this_->route, this_->vehicleprofile);
+ }
+ }
}
/**
static int
tracking_angle_delta(struct tracking *tr, int vehicle_angle, int street_angle, int flags)
{
- int full=180,ret=360,fwd,rev;
+ int full=180,ret=360,fwd=0,rev=0;
struct vehicleprofile *profile=tr->vehicleprofile;
- fwd=((flags & profile->flags_forward_mask) == profile->flags);
- rev=((flags & profile->flags_reverse_mask) == profile->flags);
+
+ if (profile) {
+ fwd=((flags & profile->flags_forward_mask) == profile->flags);
+ rev=((flags & profile->flags_reverse_mask) == profile->flags);
+ }
if (fwd || rev) {
if (!fwd || !rev) {
full=360;