Fix order index wrapping when depth exceeded in AdvanceOrderIndex
This commit is contained in:
@@ -630,6 +630,9 @@ void AdvanceOrderIndex(const Vehicle *v, VehicleOrderID &index)
|
|||||||
++index;
|
++index;
|
||||||
depth++;
|
depth++;
|
||||||
} while (depth < v->GetNumOrders());
|
} while (depth < v->GetNumOrders());
|
||||||
|
|
||||||
|
/* Wrap around. */
|
||||||
|
if (index >= v->GetNumOrders()) index = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int PredictStationStoppingLocation(const Train *v, const Order *order, int station_length, DestinationID dest)
|
int PredictStationStoppingLocation(const Train *v, const Order *order, int station_length, DestinationID dest)
|
||||||
|
|||||||
Reference in New Issue
Block a user