Skip to content

Commit eb30a97

Browse files
authored
Merge pull request #784 from Roeterdink/IncorrectDistanceAlongTrack
Incorrect distance along track
2 parents 54f6282 + 1c37be3 commit eb30a97

File tree

1 file changed

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

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15840,7 +15840,7 @@ public StationStop CalculateStationStop(int platformStartID, int arrivalTime, in
1584015840
{
1584115841
int otherSectionIndex = thisElement.Direction == 0 ?
1584215842
otherPlatform.TCSectionIndex[0] :
15843-
otherPlatform.TCSectionIndex[thisPlatform.TCSectionIndex.Count - 1];
15843+
otherPlatform.TCSectionIndex[otherPlatform.TCSectionIndex.Count - 1];
1584415844
if (otherSectionIndex == beginSectionIndex)
1584515845
{
1584615846
if (otherPlatform.TCOffset[0, thisElement.Direction] < actualBegin)
@@ -19172,7 +19172,7 @@ public float GetDistanceAlongRoute(int startSectionIndex, float startOffset,
1917219172
{
1917319173
float totalLength = startOffset;
1917419174

19175-
if (startSectionIndex == endSectionIndex)
19175+
if (startSectionIndex == endSectionIndex && startSectionIndex > -1)
1917619176
{
1917719177
TrackCircuitSection thisSection = signals.TrackCircuitList[this[startSectionIndex].TCSectionIndex];
1917819178
totalLength = startOffset - (thisSection.Length - endOffset);

0 commit comments

Comments
 (0)