Skip to content

Commit 25b7bfb

Browse files
committed
Automatic merge of T1.6-rc8-48-ga5be129223 and 14 pull requests
- Pull request #1086 at e10390b: Add Settings Exporter tool (copy settings to INI, etc) - Pull request #1091 at 9b80fac: Automatic speed control - Pull request #1104 at ccc5c4d: 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 #1124 at e241a0d: Built-in PBL2 brake controller - Pull request #1130 at 8ae6bb7: Fix F9 points to an incorrect car ID. - Pull request #1143 at 36d87c3: Status in Work Orders popup set too fast - Pull request #1152 at 66dfd09: fix: Clean up multiple issues with data logger - Pull request #1155 at 40f8c34: fix for illegal characters in refeerence to Shape file - Pull request #1157 at 39cd994: Dynamic brake authorization by TCS - Pull request #1082 at 5845a1a: Allow variable water level in glass gauge - Pull request #1128 at 1d7643d: Particle Emitter Overhaul
16 parents 59fb032 + a5be129 + e10390b + 9b80fac + ccc5c4d + 270f22f + ba3c47f + 91d2d26 + e241a0d + 8ae6bb7 + 36d87c3 + 66dfd09 + 40f8c34 + 39cd994 + 5845a1a + 1d7643d commit 25b7bfb

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

Source/Orts.Simulation/Simulation/Activity.cs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,9 +1328,12 @@ override public Boolean Triggered(Activity activity)
13281328
consistTrain = matchesConsistNoOrder(ChangeWagonIdList);
13291329
if (consistTrain != null)
13301330
{
1331-
if (atSiding(consistTrain.FrontTDBTraveller, consistTrain.RearTDBTraveller, this.SidingEnd1, this.SidingEnd2))
1331+
if (consistTrain.TrainType == Train.TRAINTYPE.STATIC)
13321332
{
1333-
triggered = true;
1333+
if (atSiding(consistTrain.FrontTDBTraveller, consistTrain.RearTDBTraveller, this.SidingEnd1, this.SidingEnd2))
1334+
{
1335+
triggered = true;
1336+
}
13341337
}
13351338
}
13361339
break;
@@ -1379,7 +1382,7 @@ private Train matchesConsist(List<string> wagonIdList)
13791382
/// <summary>
13801383
/// Finds the train that contains the wagons in the list.
13811384
/// Exact order is not required.
1382-
/// Some lists may only contain the first and last wagon.
1385+
/// Some lists may only contain the first and last wagon. Check that first and last wagon match with those two wagons in the activity list.
13831386
/// </summary>
13841387
/// <param name="wagonIdList"></param>
13851388
/// <returns>train or null</returns>
@@ -1394,9 +1397,13 @@ private Train matchesConsistNoOrder(List<string> wagonIdList)
13941397
{
13951398
nWagonListCars++;
13961399
}
1397-
if (nWagonListCars == trainItem.Cars.Count)
1400+
if (nWagonListCars == wagonIdList.Count)
13981401
{
1399-
return trainItem;
1402+
if (((wagonIdList[0] == trainItem.Cars[0].CarID) && (wagonIdList[wagonIdList.Count - 1] == trainItem.Cars[trainItem.Cars.Count - 1].CarID)) ||
1403+
((wagonIdList[0] == trainItem.Cars[trainItem.Cars.Count - 1].CarID) && (wagonIdList[wagonIdList.Count - 1] == trainItem.Cars[0].CarID)))
1404+
{
1405+
return trainItem;
1406+
}
14001407
}
14011408
}
14021409
}

0 commit comments

Comments
 (0)