From 677ea100b37b036d88e75f7fd27bcd9f79e6425d Mon Sep 17 00:00:00 2001 From: frosch Date: Sat, 9 May 2009 13:37:18 +0000 Subject: (svn r16260) -Codechange: Add Vehicle::IncrementOrderIndex() to deduplicate some code. --- src/ship_cmd.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/ship_cmd.cpp') 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(); } } } -- cgit v1.2.3-54-g00ecf