Fix order index wrapping when depth exceeded in AdvanceOrderIndex

pull/221/head
Jonathan G Rennison 3 years ago
parent 18471da6e1
commit 460d504269

@ -630,6 +630,9 @@ void AdvanceOrderIndex(const Vehicle *v, VehicleOrderID &index)
++index;
depth++;
} 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)

Loading…
Cancel
Save