@@ -6791,14 +6791,12 @@ public virtual bool CheckRouteActions(float elapsedClockSeconds)
67916791 if (positionNowBack == PresentPosition[0].TCSectionIndex && directionNowBack != PresentPosition[0].TCDirection)
67926792 {
67936793 ReverseFormation(IsActualPlayerTrain);
6794- // active subpath must be incremented in parallel in incorporated train if present
6795- if (IncorporatedTrainNo >= 0) IncrementSubpath(Simulator.TrainDictionary[IncorporatedTrainNo]);
6794+ TryIncrementSubpath();
67966795 }
67976796 else if (positionNow == PresentPosition[1].TCSectionIndex && directionNow != PresentPosition[1].TCDirection)
67986797 {
67996798 ReverseFormation(IsActualPlayerTrain);
6800- // active subpath must be incremented in parallel in incorporated train if present
6801- if (IncorporatedTrainNo >= 0) IncrementSubpath(Simulator.TrainDictionary[IncorporatedTrainNo]);
6799+ TryIncrementSubpath();
68026800 }
68036801 }
68046802
@@ -11611,6 +11609,23 @@ public void TemporarilyRemoveFromTrack()
1161111609 activeActions.Clear();
1161211610 }
1161311611
11612+ //================================================================================================//
11613+ //
11614+ // Checks if it has to go to next active subpath
11615+ //
11616+ private void TryIncrementSubpath()
11617+ {
11618+ // active subpath must be incremented in parallel in incorporated train if present; not just after incorporation
11619+ if (IncorporatedTrainNo >= 0)
11620+ {
11621+ var incorporatedTrain = Simulator.TrainDictionary[IncorporatedTrainNo];
11622+ if (incorporatedTrain.PresentPosition[0].TCSectionIndex != PresentPosition[1].TCSectionIndex && incorporatedTrain.PresentPosition[1].TCSectionIndex != PresentPosition[1].TCSectionIndex)
11623+ IncrementSubpath(incorporatedTrain);
11624+ incorporatedTrain.PresentPosition[0].TCSectionIndex = -1;
11625+ incorporatedTrain.PresentPosition[1].TCSectionIndex = -1;
11626+ }
11627+ }
11628+
1161411629 //================================================================================================//
1161511630 //
1161611631 // Goes to next active subpath
0 commit comments