summaryrefslogtreecommitdiff
path: root/src/timetable_cmd.cpp
diff options
context:
space:
mode:
authormaedhros <maedhros@openttd.org>2007-06-25 17:17:40 +0000
committermaedhros <maedhros@openttd.org>2007-06-25 17:17:40 +0000
commite7cd217f1dbfda17d8ae9d20627aec9a51113a7b (patch)
treead80d0bff873c11f072e87cbaab3f0091eba4b96 /src/timetable_cmd.cpp
parent1f4c0380cd232fcf5bb4eaf4fe3a011778985225 (diff)
downloadopenttd-e7cd217f1dbfda17d8ae9d20627aec9a51113a7b.tar.xz
(svn r10327) -Fix (r10236) [FS#934]: Vehicles wait at stations when they arrive early even
if they haven't been timetabled to wait, so make sure the lateness counter gets updated as well.
Diffstat (limited to 'src/timetable_cmd.cpp')
-rw-r--r--src/timetable_cmd.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/timetable_cmd.cpp b/src/timetable_cmd.cpp
index c210d9420..ee333cb78 100644
--- a/src/timetable_cmd.cpp
+++ b/src/timetable_cmd.cpp
@@ -95,7 +95,10 @@ void UpdateVehicleTimetable(Vehicle *v, bool travelling)
v->current_order_time = 0;
- if (!_patches.timetabling || timetabled == 0) return;
+ /* Vehicles will wait at stations if they arrive early even if they are not
+ * timetabled to wait there, so make sure the lateness counter is updated
+ * when this happens. */
+ if (!_patches.timetabling || (timetabled == 0 && (travelling || v->lateness_counter >= 0))) return;
v->lateness_counter -= (timetabled - time_taken);