diff options
author | frosch <frosch@openttd.org> | 2009-05-09 13:37:18 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2009-05-09 13:37:18 +0000 |
commit | 677ea100b37b036d88e75f7fd27bcd9f79e6425d (patch) | |
tree | 8a0b0c7b14307007ccff3bcdb57475ba2ebc20c5 /src/vehicle.cpp | |
parent | a8aa4e2148747bc880ee430a1fc600767d1e0f89 (diff) | |
download | openttd-677ea100b37b036d88e75f7fd27bcd9f79e6425d.tar.xz |
(svn r16260) -Codechange: Add Vehicle::IncrementOrderIndex() to deduplicate some code.
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); |