1
0
Fork 0

Codefix: Timetable display rows are not related to OrderID. (#13909)

pull/13926/head
Peter Nelson 2025-03-30 20:25:55 +01:00 committed by GitHub
parent 68ff7e5209
commit 99c6e85356
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -272,7 +272,7 @@ struct TimetableWindow : Window {
int GetOrderFromTimetableWndPt(int y, [[maybe_unused]] const Vehicle *v)
{
int32_t sel = this->vscroll->GetScrolledRowFromWidget(y, this, WID_VT_TIMETABLE_PANEL, WidgetDimensions::scaled.framerect.top);
if (sel == INT32_MAX) return OrderID::Invalid().base();
if (sel == INT32_MAX) return sel;
assert(IsInsideBS(sel, 0, v->GetNumOrders() * 2));
return sel;
}
@ -651,7 +651,7 @@ struct TimetableWindow : Window {
int selected = GetOrderFromTimetableWndPt(pt.y, v);
this->CloseChildWindows();
this->sel_index = (selected == OrderID::Invalid().base() || selected == this->sel_index) ? -1 : selected;
this->sel_index = (selected == INT32_MAX || selected == this->sel_index) ? -1 : selected;
break;
}