From d2724d35e80d5d7eee0b6f064584f4b82f53a0d2 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Fri, 22 Aug 2025 17:51:39 +0200 Subject: InTransit: correctly estimate trip position if vehicle is currently at a stop --- lib/Travelynx/Model/InTransit.pm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib') diff --git a/lib/Travelynx/Model/InTransit.pm b/lib/Travelynx/Model/InTransit.pm index 5f27a22..ab724a4 100644 --- a/lib/Travelynx/Model/InTransit.pm +++ b/lib/Travelynx/Model/InTransit.pm @@ -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 -- cgit v1.2.3