Skip to content

Commit

Permalink
Incorrect distance along track
Browse files Browse the repository at this point in the history
  • Loading branch information
Roeterdink committed Jan 21, 2023
1 parent 3ffb9bc commit 1c37be3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/Orts.Simulation/Simulation/Physics/Train.cs
Expand Up @@ -15837,7 +15837,7 @@ public StationStop CalculateStationStop(int platformStartID, int arrivalTime, in
{
int otherSectionIndex = thisElement.Direction == 0 ?
otherPlatform.TCSectionIndex[0] :
otherPlatform.TCSectionIndex[thisPlatform.TCSectionIndex.Count - 1];
otherPlatform.TCSectionIndex[otherPlatform.TCSectionIndex.Count - 1];
if (otherSectionIndex == beginSectionIndex)
{
if (otherPlatform.TCOffset[0, thisElement.Direction] < actualBegin)
Expand Down Expand Up @@ -19169,7 +19169,7 @@ public bool SignalIsAheadOfTrain(SignalObject thisSignal, TCPosition trainPositi
{
float totalLength = startOffset;

if (startSectionIndex == endSectionIndex)
if (startSectionIndex == endSectionIndex && startSectionIndex > -1)
{
TrackCircuitSection thisSection = signals.TrackCircuitList[this[startSectionIndex].TCSectionIndex];
totalLength = startOffset - (thisSection.Length - endOffset);
Expand Down

0 comments on commit 1c37be3

Please sign in to comment.