Skip to content

Commit 1c37be3

Browse files
committed
Incorrect distance along track
1 parent 3ffb9bc commit 1c37be3

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
@@ -15837,7 +15837,7 @@ public StationStop CalculateStationStop(int platformStartID, int arrivalTime, in
1583715837
{
1583815838
int otherSectionIndex = thisElement.Direction == 0 ?
1583915839
otherPlatform.TCSectionIndex[0] :
15840-
otherPlatform.TCSectionIndex[thisPlatform.TCSectionIndex.Count - 1];
15840+
otherPlatform.TCSectionIndex[otherPlatform.TCSectionIndex.Count - 1];
1584115841
if (otherSectionIndex == beginSectionIndex)
1584215842
{
1584315843
if (otherPlatform.TCOffset[0, thisElement.Direction] < actualBegin)
@@ -19169,7 +19169,7 @@ public float GetDistanceAlongRoute(int startSectionIndex, float startOffset,
1916919169
{
1917019170
float totalLength = startOffset;
1917119171

19172-
if (startSectionIndex == endSectionIndex)
19172+
if (startSectionIndex == endSectionIndex && startSectionIndex > -1)
1917319173
{
1917419174
TrackCircuitSection thisSection = signals.TrackCircuitList[this[startSectionIndex].TCSectionIndex];
1917519175
totalLength = startOffset - (thisSection.Length - endOffset);

0 commit comments

Comments
 (0)