Unverified Commit d2724d35 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

InTransit: correctly estimate trip position if vehicle is currently at a stop

parent 4bee6aab
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1635,6 +1635,12 @@ sub estimate_trip_position {
		  // $route[$i][2]{rt_dep} // $route[$i][2]{sched_dep} // 0;
		my $ts_dep = $route[$i][2]{rt_dep} // $route[$i][2]{sched_dep}
		  // $route[$i][2]{rt_arr} // $route[$i][2]{sched_arr} // 0;
		if ( $ts and $ts_dep and $now >= $ts and $now <= $ts_dep ) {

			# Currently at a stop
			@now_latlon = ( $route[$i][2]{lat}, $route[$i][2]{lon} );
			last;
		}
		if (    $ts
			and $prev_ts
			and $now > $prev_ts