1
0
Fork 0

Fix #10823, Fix #10811: Order list has end marker row. (#10825)

pull/10828/head
PeterN 2023-05-14 13:04:59 +01:00 committed by GitHub
parent 64930c343a
commit 9eb0cca93a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -562,7 +562,8 @@ private:
{
int sel = this->vscroll->GetScrolledRowFromWidget(y, this, WID_O_ORDER_LIST, WidgetDimensions::scaled.framerect.top);
if (sel == INT_MAX) return INVALID_VEH_ORDER_ID;
assert(IsInsideBS(sel, 0, vehicle->GetNumOrders()));
/* One past the orders is the 'End of Orders' line. */
assert(IsInsideBS(sel, 0, vehicle->GetNumOrders() + 1));
return sel;
}