Skip to content

Commit 4fad4b5

Browse files
committed
Automatic merge of T1.6-rc6-37-g6dd094783 and 13 pull requests
- Pull request #1086 at e10390b: Add Settings Exporter tool (copy settings to INI, etc) - Pull request #1104 at 86d38a2: Handle simple adhesion within the axle module - Pull request #1115 at 270f22f: Do not activate ETS switch if no suitable cars are attached - Pull request #1120 at ba3c47f: Automatically Calculate Friction Values if Missing - Pull request #1121 at 91d2d26: Manually Override Articulation - Pull request #1130 at 8ae6bb7: Fix F9 points to an incorrect car ID. - Pull request #1139 at 03c6f8f: Fix for bug https://bugs.launchpad.net/or/+bug/2117357. - Pull request #1142 at a24747c: Fix Light Position Calculation for Deeper Hierarchy Levels - Pull request #1143 at 71e57d2: Status in Work Orders popup set too fast - Pull request #1082 at 5845a1a: Allow variable water level in glass gauge - Pull request #1081 at 689494b: Brake cuts power unification - Pull request #1124 at fab5457: Built-in PBL2 brake controller - Pull request #1128 at 58de4c3: Particle Emitter Overhaul
15 parents 788c1ae + 6dd0947 + e10390b + 86d38a2 + 270f22f + ba3c47f + 91d2d26 + 8ae6bb7 + 03c6f8f + a24747c + 71e57d2 + 5845a1a + 689494b + fab5457 + 58de4c3 commit 4fad4b5

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

Source/Orts.Simulation/Simulation/Activity.cs

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1377,33 +1377,28 @@ private Train matchesConsist(List<string> wagonIdList)
13771377
return null;
13781378
}
13791379
/// <summary>
1380-
/// Finds the train that contains exactly the wagons (and maybe loco) in the list. Exact order is not required.
1380+
/// Finds the train that contains exactly the wagons in the list. Exact order is not required.
13811381
/// </summary>
13821382
/// <param name="wagonIdList"></param>
13831383
/// <returns>train or null</returns>
13841384
private Train matchesConsistNoOrder(List<string> wagonIdList)
13851385
{
13861386
foreach (var trainItem in Simulator.Trains)
13871387
{
1388-
int nCars = 0;//all cars other than WagonIdList.
1389-
int nWagonListCars = 0;//individual wagon drop.
1388+
int nWagonListCars = 0;
13901389
foreach (var item in trainItem.Cars)
13911390
{
1392-
if (!wagonIdList.Contains(item.CarID)) nCars++;
1393-
if (wagonIdList.Contains(item.CarID)) nWagonListCars++;
1394-
}
1395-
// Compare two lists to make sure wagons are present.
1396-
bool listsMatch = true;
1397-
//support individual wagonIdList drop
1398-
if (trainItem.Cars.Count - nCars == (wagonIdList.Count == nWagonListCars ? wagonIdList.Count : nWagonListCars))
1391+
if (wagonIdList.Contains(item.CarID))
13991392
{
1400-
if (excludesWagons(trainItem, wagonIdList)) listsMatch = false;//all wagons dropped
1401-
1402-
if (listsMatch) return trainItem;
1403-
1393+
nWagonListCars++;
1394+
}
1395+
if (nWagonListCars == trainItem.Cars.Count)
1396+
{
1397+
return trainItem;
1398+
}
1399+
}
14041400
}
14051401

1406-
}
14071402
return null;
14081403
}
14091404
/// <summary>

0 commit comments

Comments
 (0)