Departure boards: Fix handling of invalid/empty dispatch schedules

This commit is contained in:
Jonathan G Rennison
2024-03-10 11:22:51 +00:00
parent fae9df329e
commit 2140e3fc3b
2 changed files with 17 additions and 10 deletions

View File

@@ -748,7 +748,6 @@ void DeparturesWindow<Twaypoint>::DrawDeparturesListItems(const Rect &r) const
uint arrival = 0;
StateTicks now_date = _state_ticks;
StateTicks max_date = now_date + GetDeparturesMaxTicksAhead();
/* Draw each departure. */
for (uint i = 0; i < max_departures; ++i) {
@@ -774,11 +773,6 @@ void DeparturesWindow<Twaypoint>::DrawDeparturesListItems(const Rect &r) const
continue;
}
/* If for some reason the departure is too far in the future or is at a negative time, skip it. */
if (d->scheduled_tick > max_date || d->scheduled_tick < 0) {
continue;
}
if (d->terminus == INVALID_STATION) continue;
StringID time_str;