Skip to content

Commit 84f72b8

Browse files
Some lists may only contain the first and last wagon. Undone the previous change in matchesConsistNoOrder.
1 parent 1ad59d7 commit 84f72b8

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Source/Orts.Simulation/Simulation/Activity.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,7 +1376,9 @@ private Train matchesConsist(List<string> wagonIdList)
13761376
return null;
13771377
}
13781378
/// <summary>
1379-
/// Finds the train that contains exactly the wagons in the list. Exact order is not required.
1379+
/// Finds the train that contains the wagons in the list.
1380+
/// Exact order is not required.
1381+
/// Some lists may only contain the first and last wagon.
13801382
/// </summary>
13811383
/// <param name="wagonIdList"></param>
13821384
/// <returns>train or null</returns>
@@ -1391,10 +1393,10 @@ private Train matchesConsistNoOrder(List<string> wagonIdList)
13911393
{
13921394
nWagonListCars++;
13931395
}
1394-
}
1395-
if (nWagonListCars == trainItem.Cars.Count)
1396-
{
1397-
return trainItem;
1396+
if (nWagonListCars == trainItem.Cars.Count)
1397+
{
1398+
return trainItem;
1399+
}
13981400
}
13991401
}
14001402

0 commit comments

Comments
 (0)