Skip to content

Commit 87c34a7

Browse files
committed
Remove forced processed ClearSection actions
1 parent 3ffb9bc commit 87c34a7

File tree

1 file changed

+7
-9
lines changed
  • Source/Orts.Simulation/Simulation/Physics

1 file changed

+7
-9
lines changed

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)