(svn r10327) -Fix (r10236) [FS#934]: Vehicles wait at stations when they arrive early even
authormaedhros
Mon, 25 Jun 2007 17:17:40 +0000
changeset 7558 ca45ff710b35
parent 7557 6f6a1e755e3d
child 7559 8e7ef897f126
(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.
src/timetable_cmd.cpp
--- a/src/timetable_cmd.cpp	Mon Jun 25 17:02:37 2007 +0000
+++ b/src/timetable_cmd.cpp	Mon Jun 25 17:17:40 2007 +0000
@@ -95,7 +95,10 @@
 
 	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);