Mercurial > hg > openttd
changeset 7070:c856638fde6e draft
(svn r10335) -Fix (r10331): Increment the current order index *after* using it in UpdateVehicleTimetable.
author | maedhros <maedhros@openttd.org> |
---|---|
date | Mon, 25 Jun 2007 23:14:13 +0000 |
parents | 6de5150e902f |
children | ddb9ef82e02e |
files | src/aircraft_cmd.cpp src/roadveh_cmd.cpp src/ship_cmd.cpp src/train_cmd.cpp src/vehicle.cpp |
diffstat | 5 files changed, 8 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -1344,8 +1344,8 @@ if (!(v->current_order.flags & OF_PART_OF_ORDERS)) return; if (v->current_order.flags & OF_SERVICE_IF_NEEDED && !VehicleNeedsService(v)) { + UpdateVehicleTimetable(v, true); v->cur_order_index++; - UpdateVehicleTimetable(v, true); } break;
--- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -758,8 +758,8 @@ if (!(v->current_order.flags & OF_PART_OF_ORDERS)) return; if (v->current_order.flags & OF_SERVICE_IF_NEEDED && !VehicleNeedsService(v)) { + UpdateVehicleTimetable(v, true); v->cur_order_index++; - UpdateVehicleTimetable(v, true); } break;
--- a/src/ship_cmd.cpp +++ b/src/ship_cmd.cpp @@ -258,8 +258,8 @@ if (!(v->current_order.flags & OF_PART_OF_ORDERS)) return; if (v->current_order.flags & OF_SERVICE_IF_NEEDED && !VehicleNeedsService(v)) { + UpdateVehicleTimetable(v, true); v->cur_order_index++; - UpdateVehicleTimetable(v, true); } break; @@ -696,9 +696,9 @@ DistanceManhattan(v->dest_tile, gp.new_tile) <= 3) { /* 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->current_order.type = OT_DUMMY; - UpdateVehicleTimetable(v, true); InvalidateVehicleOrder(v); } else { /* Non-buoy orders really need to reach the tile */
--- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -2380,8 +2380,8 @@ if (!(v->current_order.flags & OF_PART_OF_ORDERS)) return false; if ((v->current_order.flags & OF_SERVICE_IF_NEEDED) && !VehicleNeedsService(v)) { + UpdateVehicleTimetable(v, true); v->cur_order_index++; - UpdateVehicleTimetable(v, true); } break; @@ -2395,9 +2395,9 @@ /* check if we've reached the waypoint? */ bool at_waypoint = false; if (v->current_order.type == OT_GOTO_WAYPOINT && v->tile == v->dest_tile) { + UpdateVehicleTimetable(v, true); v->cur_order_index++; at_waypoint = true; - UpdateVehicleTimetable(v, true); } /* check if we've reached a non-stop station while TTDPatch nonstop is enabled.. */ @@ -2405,8 +2405,8 @@ v->current_order.flags & OF_NON_STOP && IsTileType(v->tile, MP_STATION) && v->current_order.dest == GetStationIndex(v->tile)) { + UpdateVehicleTimetable(v, true); v->cur_order_index++; - UpdateVehicleTimetable(v, true); } /* Get the current order */
--- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -2368,8 +2368,8 @@ if (HASBIT(t.flags, OFB_PART_OF_ORDERS)) { /* Part of orders */ + UpdateVehicleTimetable(v, true); v->cur_order_index++; - UpdateVehicleTimetable(v, true); } else if (HASBIT(t.flags, OFB_HALT_IN_DEPOT)) { /* Force depot visit */ v->vehstatus |= VS_STOPPED;