(svn r16260) -Codechange: Add Vehicle::IncrementOrderIndex() to deduplicate some code.
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user