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/ship_cmd.cpp | |
parent | a8aa4e2148747bc880ee430a1fc600767d1e0f89 (diff) | |
download | openttd-677ea100b37b036d88e75f7fd27bcd9f79e6425d.tar.xz |
(svn r16260) -Codechange: Add Vehicle::IncrementOrderIndex() to deduplicate some code.
Diffstat (limited to 'src/ship_cmd.cpp')
-rw-r--r-- | src/ship_cmd.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp index 6f1af330c..4abf9e0da 100644 --- a/src/ship_cmd.cpp +++ b/src/ship_cmd.cpp @@ -235,7 +235,7 @@ TileIndex Ship::GetOrderStationLocation(StationID station) if (st->dock_tile != INVALID_TILE) { return TILE_ADD(st->dock_tile, ToTileIndexDiff(GetDockOffset(st->dock_tile))); } else { - this->cur_order_index++; + this->IncrementOrderIndex(); return 0; } } @@ -614,9 +614,8 @@ static void ShipController(Vehicle *v) /* We got within 3 tiles of our target buoy, so let's skip to our * next order */ UpdateVehicleTimetable(v, true); - v->cur_order_index++; + v->IncrementOrderIndex(); v->current_order.MakeDummy(); - InvalidateVehicleOrder(v, 0); } else { /* Non-buoy orders really need to reach the tile */ if (v->dest_tile == gp.new_tile) { @@ -635,8 +634,7 @@ static void ShipController(Vehicle *v) v->BeginLoading(); } else { // leave stations without docks right aways v->current_order.MakeLeaveStation(); - v->cur_order_index++; - InvalidateVehicleOrder(v, 0); + v->IncrementOrderIndex(); } } } |