File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
Source/Orts.Simulation/Simulation/Physics Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -11213,19 +11213,17 @@ public void RemoveFromTrack()
1121311213 LastReservedSection[0] = -1;
1121411214 LastReservedSection[1] = -1;
1121511215
11216- // clear outstanding clear sections
11216+ // clear outstanding clear sections and remove them from queue as they are no longer required
1121711217
11218- foreach (DistanceTravelledItem thisAction in requiredActions)
11218+ List<DistanceTravelledItem> activeActions = requiredActions.GetActions(99999999f, typeof(ClearSectionItem));
11219+ foreach (DistanceTravelledItem thisAction in activeActions)
1121911220 {
11220- if (thisAction is ClearSectionItem)
11221- {
11222- ClearSectionItem thisItem = thisAction as ClearSectionItem;
11223- TrackCircuitSection thisSection = signalRef.TrackCircuitList[thisItem.TrackSectionIndex];
11224- thisSection.ClearOccupied(this, true);
11225- }
11221+ ClearSectionItem thisItem = thisAction as ClearSectionItem;
11222+ TrackCircuitSection thisSection = signalRef.TrackCircuitList[thisItem.TrackSectionIndex];
11223+ thisSection.ClearOccupied(this, true);
1122611224 }
1122711225 }
11228-
11226+
1122911227 //================================================================================================//
1123011228 //
1123111229 // Update track actions after coupling
You can’t perform that action at this time.
0 commit comments