summaryrefslogtreecommitdiff
path: root/src/ship_cmd.cpp
diff options
context:
space:
mode:
authormaedhros <maedhros@openttd.org>2007-06-20 19:17:22 +0000
committermaedhros <maedhros@openttd.org>2007-06-20 19:17:22 +0000
commitcf0118ee63603132dc1d08d7f7e800b26e53fc97 (patch)
tree1a82d9ac3d2c0f66dac9c5f6857c4e49f057b100 /src/ship_cmd.cpp
parenta982fe2e807f80c8a6478c358b3875535c9346b4 (diff)
downloadopenttd-cf0118ee63603132dc1d08d7f7e800b26e53fc97.tar.xz
(svn r10236) -Feature: Introduce a form of timetabling for vehicles.
Diffstat (limited to 'src/ship_cmd.cpp')
-rw-r--r--src/ship_cmd.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp
index 90edf4719..23ca3b337 100644
--- a/src/ship_cmd.cpp
+++ b/src/ship_cmd.cpp
@@ -11,6 +11,7 @@
#include "map.h"
#include "tile.h"
#include "vehicle.h"
+#include "timetable.h"
#include "command.h"
#include "pathfind.h"
#include "station_map.h"
@@ -258,6 +259,7 @@ static void ProcessShipOrder(Vehicle *v)
if (v->current_order.flags & OF_SERVICE_IF_NEEDED &&
!VehicleNeedsService(v)) {
v->cur_order_index++;
+ UpdateVehicleTimetable(v, true);
}
break;
@@ -648,6 +650,7 @@ static void ShipController(Vehicle *v)
TrackBits tracks;
v->tick_counter++;
+ v->current_order_time++;
if (v->breakdown_ctr != 0) {
if (v->breakdown_ctr <= 2) {
@@ -695,6 +698,7 @@ static void ShipController(Vehicle *v)
* next order */
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 */