Ticket #510: navit.c.patch

File navit.c.patch, 914 bytes (added by mis, 12 years ago)
  • navit.c

     
    22982298        }
    22992299        if (sscanf(iso8601_attr.u.str,"%d-%02d-%02dT",&year,&month,&day) != 3)
    23002300                return;
     2301        if (vehicle_get_attr(n->vehicle->vehicle, attr_position_valid, &geo_attr,NULL) && geo_attr.u.num==attr_position_valid_invalid) {
     2302                return; //No valid fix yet
     2303        }
    23012304        if (vehicle_get_attr(n->vehicle->vehicle, attr_position_coord_geo,&geo_attr,NULL)!=1) {
    23022305                //No position - no sun
    23032306                return;
    23042307        }
    2305         if (vehicle_get_attr(n->vehicle->vehicle, attr_position_valid, &geo_attr,NULL) && geo_attr.u.num==attr_position_valid_invalid) {
    2306                 return; //No valid fix yet
    2307         }
    23082308       
    23092309        //We calculate sunrise anyway, cause it is need both for day and for night
    23102310        if (__sunriset__(year,month,day,geo_attr.u.coord_geo->lat,geo_attr.u.coord_geo->lng,35,1,&trise,&tset)!=0) {