|
@@ -2377,14 +2377,14 @@ static bool ProcessTrainOrder(Vehicle *v
|
|
|
{
|
|
|
switch (v->current_order.type) {
|
|
|
case OT_GOTO_DEPOT:
|
|
|
if (!(v->current_order.flags & OF_PART_OF_ORDERS)) return false;
|
|
|
if ((v->current_order.flags & OF_SERVICE_IF_NEEDED) &&
|
|
|
!VehicleNeedsService(v)) {
|
|
|
UpdateVehicleTimetable(v, true);
|
|
|
v->cur_order_index++;
|
|
|
UpdateVehicleTimetable(v, true);
|
|
|
}
|
|
|
break;
|
|
|
|
|
|
case OT_LOADING:
|
|
|
case OT_LEAVESTATION:
|
|
|
return false;
|
|
@@ -2392,24 +2392,24 @@ static bool ProcessTrainOrder(Vehicle *v
|
|
|
default: break;
|
|
|
}
|
|
|
|
|
|
/* check if we've reached the waypoint? */
|
|
|
bool at_waypoint = false;
|
|
|
if (v->current_order.type == OT_GOTO_WAYPOINT && v->tile == v->dest_tile) {
|
|
|
UpdateVehicleTimetable(v, true);
|
|
|
v->cur_order_index++;
|
|
|
at_waypoint = true;
|
|
|
UpdateVehicleTimetable(v, true);
|
|
|
}
|
|
|
|
|
|
/* check if we've reached a non-stop station while TTDPatch nonstop is enabled.. */
|
|
|
if (_patches.new_nonstop &&
|
|
|
v->current_order.flags & OF_NON_STOP &&
|
|
|
IsTileType(v->tile, MP_STATION) &&
|
|
|
v->current_order.dest == GetStationIndex(v->tile)) {
|
|
|
UpdateVehicleTimetable(v, true);
|
|
|
v->cur_order_index++;
|
|
|
UpdateVehicleTimetable(v, true);
|
|
|
}
|
|
|
|
|
|
/* Get the current order */
|
|
|
if (v->cur_order_index >= v->num_orders) v->cur_order_index = 0;
|
|
|
|
|
|
const Order *order = GetVehicleOrder(v, v->cur_order_index);
|