Skip to content

Commit 311a912

Browse files
committed
Automatic merge of T1.5.1-1608-g273f2ef97 and 11 pull requests
- Pull request #900 at b54024b: DMI in 3D cab + two more dials - Pull request #1030 at d3ae4a2: Refactor settings, in prep for settings exporter - Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH - Pull request #961 at ffccb2e: Improvements for Power Supplies - Pull request #1015 at 1ade99e: Enhancements for EP brakes - Pull request #1029 at 31fd7d2: Superelevation Follow Up Fixes - Pull request #1031 at 34aa23a: Multiplayer Server, forked from Open Rails Ultimate; blueprint https://blueprints.launchpad.net/or/+spec/multiplayer-server - Pull request #1047 at eb8027b: Docs: adds translation docs - Pull request #1058 at 626ebed: Refactor notification parameters - Pull request #1055 at 1a01818: Route Based TTrack Sounds - Pull request #896 at f1681df: First implementation of https://blueprints.launchpad.net/or/+spec/specific-sounds-for-ai-trains
13 parents 581420e + 273f2ef + b54024b + d3ae4a2 + 1f5ba4c + ffccb2e + 1ade99e + 31fd7d2 + 34aa23a + eb8027b + 626ebed + 1a01818 + f1681df commit 311a912

File tree

1 file changed

+6
-2
lines changed
  • Source/Orts.Simulation/Simulation/Physics

1 file changed

+6
-2
lines changed

Source/Orts.Simulation/Simulation/Physics/Train.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2006,7 +2006,9 @@ public virtual void Update(float elapsedClockSeconds, bool auxiliaryUpdate = tru
20062006
LogTrainSpeed(Simulator.ClockTime);
20072007
}
20082008

2009-
// Initialise track joint trigger points. Only runs once at start up.
2009+
// Initialise track joint trigger points. Sets the trigger point for the track joint reletative to other cars.
2010+
// This is then reset every time a track joint is triggered, and positioned the same distance apart, hence reletative positions are maintained.
2011+
// Only runs once at start up.
20102012
if (SoundSetupInitialise)
20112013
{
20122014
var trackjointdistanceM = (float)Simulator.TRK.Tr_RouteFile.DistanceBetweenTrackJointsM;
@@ -2017,11 +2019,13 @@ public virtual void Update(float elapsedClockSeconds, bool auxiliaryUpdate = tru
20172019
car.realTimeTrackJointDistanceM = trackjointdistanceM + trainLengthM;
20182020
trainLengthM += car.CarLengthM;
20192021

2022+
// Track joint "reached" move car joint into next track joint sesction
20202023
if (trainLengthM > (float)Simulator.TRK.Tr_RouteFile.DistanceBetweenTrackJointsM)
20212024
{
2022-
trainLengthM = 0;
2025+
trainLengthM -= (float)Simulator.TRK.Tr_RouteFile.DistanceBetweenTrackJointsM;
20232026
}
20242027

2028+
// Trace.TraceInformation("Initialise Track Joints - CarID {0} RealDistance {1} TrainLength {2}", car.CarID, car.realTimeTrackJointDistanceM, trainLengthM);
20252029
}
20262030

20272031
SoundSetupInitialise = false;

0 commit comments

Comments
 (0)