diff options
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r-- | src/vehicle.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 1c8de34fb..5dda6a93d 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -1067,7 +1067,7 @@ void VehicleEnterDepot(Vehicle *v) if (t.GetDepotOrderType() & ODTFB_PART_OF_ORDERS) { /* Part of orders */ UpdateVehicleTimetable(v, true); - v->cur_order_index++; + v->IncrementOrderIndex(); } if (t.GetDepotActionType() & ODATFB_HALT) { /* Vehicles are always stopped on entering depots. Do not restart this one. */ @@ -1577,8 +1577,7 @@ void Vehicle::HandleLoading(bool mode) default: return; } - this->cur_order_index++; - InvalidateVehicleOrder(this, 0); + this->IncrementOrderIndex(); } CommandCost Vehicle::SendToDepot(DoCommandFlag flags, DepotCommand command) @@ -1605,7 +1604,7 @@ CommandCost Vehicle::SendToDepot(DoCommandFlag flags, DepotCommand command) if (flags & DC_EXEC) { /* If the orders to 'goto depot' are in the orders list (forced servicing), * then skip to the next order; effectively cancelling this forced service */ - if (this->current_order.GetDepotOrderType() & ODTFB_PART_OF_ORDERS) this->cur_order_index++; + if (this->current_order.GetDepotOrderType() & ODTFB_PART_OF_ORDERS) this->IncrementOrderIndex(); this->current_order.MakeDummy(); InvalidateWindowWidget(WC_VEHICLE_VIEW, this->index, VVW_WIDGET_START_STOP_VEH); |