diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2025-08-22 17:51:39 +0200 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2025-08-22 17:51:39 +0200 |
commit | d2724d35e80d5d7eee0b6f064584f4b82f53a0d2 (patch) | |
tree | 7077a05f5d16442e85e48b95f4bfa3575657a877 /lib | |
parent | 4bee6aab18fa39400282dc43fed6c611f3db4a4d (diff) |
InTransit: correctly estimate trip position if vehicle is currently at a stop
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Travelynx/Model/InTransit.pm | 6 |
1 files changed, 6 insertions, 0 deletions
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 |