summaryrefslogtreecommitdiff
path: root/src/timetable_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-05-01 19:14:12 +0000
committerrubidium <rubidium@openttd.org>2011-05-01 19:14:12 +0000
commit1a515e6344028854c855671c19f49d8f869eb18f (patch)
treee1bba97c1a8fd80f564729cc2d5fc2049110cb2a /src/timetable_cmd.cpp
parentb27dd1dcd7375dae63724879eb0f56dd703e5312 (diff)
downloadopenttd-1a515e6344028854c855671c19f49d8f869eb18f.tar.xz
(svn r22405) -Document: some more "random-ish" tidbits
Diffstat (limited to 'src/timetable_cmd.cpp')
-rw-r--r--src/timetable_cmd.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/timetable_cmd.cpp b/src/timetable_cmd.cpp
index 32fc5feab..2145e89fc 100644
--- a/src/timetable_cmd.cpp
+++ b/src/timetable_cmd.cpp
@@ -18,6 +18,13 @@
#include "table/strings.h"
+/**
+ * Change/update a particular timetable entry.
+ * @param v The vehicle to change the timetable of.
+ * @param order_number The index of the timetable in the order list.
+ * @param time The new time of the timetable entry.
+ * @param is_journey Whether to set the waiting or travelling time.
+ */
static void ChangeTimetable(Vehicle *v, VehicleOrderID order_number, uint16 time, bool is_journey)
{
Order *order = v->GetOrder(order_number);
@@ -222,6 +229,11 @@ CommandCost CmdAutofillTimetable(TileIndex tile, DoCommandFlag flags, uint32 p1,
return CommandCost();
}
+/**
+ * Update the timetable for the vehicle.
+ * @param v The vehicle to update the timetable for.
+ * @param travelling Whether we just travelled or waited at a station.
+ */
void UpdateVehicleTimetable(Vehicle *v, bool travelling)
{
uint timetabled = travelling ? v->current_order.travel_time : v->current_order.wait_time;