Mercurial > hg > openttd
diff src/train_cmd.cpp @ 6980:cb6b3e277df0 draft
(svn r10236) -Feature: Introduce a form of timetabling for vehicles.
author | maedhros <maedhros@openttd.org> |
---|---|
date | Wed, 20 Jun 2007 19:17:22 +0000 (2007-06-20) |
parents | 83a9857fde12 |
children | a19700261804 |
line wrap: on
line diff
--- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -15,6 +15,7 @@ #include "tile.h" #include "tunnel_map.h" #include "vehicle.h" +#include "timetable.h" #include "articulated_vehicles.h" #include "command.h" #include "pathfind.h" @@ -2380,6 +2381,7 @@ if ((v->current_order.flags & OF_SERVICE_IF_NEEDED) && !VehicleNeedsService(v)) { v->cur_order_index++; + UpdateVehicleTimetable(v, true); } break; @@ -2395,6 +2397,7 @@ if (v->current_order.type == OT_GOTO_WAYPOINT && v->tile == v->dest_tile) { v->cur_order_index++; at_waypoint = true; + UpdateVehicleTimetable(v, true); } /* check if we've reached a non-stop station while TTDPatch nonstop is enabled.. */ @@ -2403,6 +2406,7 @@ IsTileType(v->tile, MP_STATION) && v->current_order.dest == GetStationIndex(v->tile)) { v->cur_order_index++; + UpdateVehicleTimetable(v, true); } /* Get the current order */ @@ -3296,6 +3300,8 @@ v->tick_counter++; if (IsFrontEngine(v)) { + v->current_order_time++; + TrainLocoHandler(v, false); /* make sure vehicle wasn't deleted. */