1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-12 17:19:09 +00:00

Fix #14295, 0455627d16: v->cur_implicit_order_index is never INVALID_VEH_ORDER_ID

This commit is contained in:
glx22
2025-05-24 14:58:06 +02:00
parent c366e6a48e
commit 34cc7fde8d

View File

@@ -366,8 +366,8 @@ StationIDStack OrderList::GetNextStoppingStation(const Vehicle *v, VehicleOrderI
VehicleOrderID next = first;
if (first == INVALID_VEH_ORDER_ID) {
next = v->cur_implicit_order_index;
if (next == INVALID_VEH_ORDER_ID) {
next = v->orders->GetFirstOrder();
if (next >= this->GetNumOrders()) {
next = this->GetFirstOrder();
if (next == INVALID_VEH_ORDER_ID) return StationID::Invalid().base();
} else {
/* GetNext never returns INVALID_VEH_ORDER_ID if there is a valid station in the list.