diff --git a/src/timetable_gui.cpp b/src/timetable_gui.cpp index 8d428cc2d9..e227b2e6cb 100644 --- a/src/timetable_gui.cpp +++ b/src/timetable_gui.cpp @@ -73,7 +73,7 @@ struct TimetableWindow : Window { sel += this->vscroll.pos; - return (sel <= v->num_orders * 2 && sel >= 0) ? sel : INVALID_ORDER; + return (sel < v->num_orders * 2 && sel >= 0) ? sel : INVALID_ORDER; } void OnPaint()