File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Source/Orts.Simulation/Simulation/Timetables Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -10390,6 +10390,12 @@ public override void CheckStationTask()
1039010390 // Get time
1039110391 int eightHundredHours = 8 * 3600;
1039210392 int sixteenHundredHours = 16 * 3600;
10393+
10394+ // Update delay if train might be running late, do not update if train is early and waiting at station
10395+ if (presentTime > StationStops[0].DepartTime)
10396+ {
10397+ Delay = TimeSpan.FromSeconds((presentTime - StationStops[0].DepartTime) % (24 * 3600));
10398+ }
1039310399
1039410400 // If moving, set departed
1039510401 if (Math.Abs(SpeedMpS) > 1.0f)
@@ -10399,6 +10405,7 @@ public override void CheckStationTask()
1039910405 AtStation = false;
1040010406 MayDepart = false;
1040110407 DisplayMessage = "";
10408+ // Update delay when departing, train may now be early
1040210409 if (StationStops[0].ArrivalTime >= 0)
1040310410 {
1040410411 Delay = TimeSpan.FromSeconds((presentTime - StationStops[0].DepartTime) % (24 * 3600));
You can’t perform that action at this time.
0 commit comments