diff options
Diffstat (limited to 'src/timetable_gui.cpp')
-rw-r--r-- | src/timetable_gui.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/timetable_gui.cpp b/src/timetable_gui.cpp index af90adc44..fa0e4d114 100644 --- a/src/timetable_gui.cpp +++ b/src/timetable_gui.cpp @@ -211,13 +211,13 @@ struct TimetableWindow : Window { int GetOrderFromTimetableWndPt(int y, const Vehicle *v) { - int sel = (y - this->GetWidget<NWidgetBase>(WID_VT_TIMETABLE_PANEL)->pos_y - WD_FRAMERECT_TOP) / FONT_HEIGHT_NORMAL; + uint sel = (y - this->GetWidget<NWidgetBase>(WID_VT_TIMETABLE_PANEL)->pos_y - WD_FRAMERECT_TOP) / FONT_HEIGHT_NORMAL; - if ((uint)sel >= this->vscroll->GetCapacity()) return INVALID_ORDER; + if (sel >= this->vscroll->GetCapacity()) return INVALID_ORDER; sel += this->vscroll->GetPosition(); - return (sel < v->GetNumOrders() * 2 && sel >= 0) ? sel : INVALID_ORDER; + return (sel < v->GetNumOrders() * 2u) ? sel : INVALID_ORDER; } /** |