summaryrefslogtreecommitdiff
path: root/lib/Travelynx.pm
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-12-17 20:01:39 +0100
committerDaniel Friesel <derf@finalrewind.org>2019-12-17 20:01:39 +0100
commitae21896982b5f53c0a011740f58a97be40bf0b30 (patch)
tree9258ac91b121b04aaa3ed2ff33a087ca95e80052 /lib/Travelynx.pm
parent9adec3ee8d1badec3dcd3643774b5e5c0e866840 (diff)
API: Add lax option
Diffstat (limited to 'lib/Travelynx.pm')
-rwxr-xr-xlib/Travelynx.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm
index 81dae20..5c54322 100755
--- a/lib/Travelynx.pm
+++ b/lib/Travelynx.pm
@@ -958,7 +958,7 @@ sub startup {
$self->helper(
'journey_sanity_check' => sub {
- my ( $self, $journey ) = @_;
+ my ( $self, $journey, $lax ) = @_;
if ( $journey->{sched_duration} and $journey->{sched_duration} < 0 )
{
@@ -983,7 +983,12 @@ sub startup {
{
return 'Zugfahrten mit über 500 km/h? Schön wär\'s.';
}
- if ( $journey->{edited} & 0x0010 ) {
+ if ( $journey->{route} and @{ $journey->{route} } > 99 ) {
+ my $stop_count = @{ $journey->{route} };
+ return
+"Die Zugfahrt hat $stop_count Unterwegshalte. Also ich weiß ja nicht so recht.";
+ }
+ if ( $journey->{edited} & 0x0010 and not $lax ) {
my @unknown_stations
= $self->grep_unknown_stations( map { $_->[0] }
@{ $journey->{route} } );