Skip to content

Commit c1651fa

Browse files
committed
Automatic merge of T1.5.1-1806-g5522fc5fa and 11 pull requests
- Pull request #570 at 362e4e7: glTF 2.0 support with PBR lighting - Pull request #1062 at bbc0013: Train Forces popup Window. - Pull request #1064 at fb4a500: Add Train Info tab to Help window (F1) - Pull request #1067 at f385422: Traction and dynamic brake retardation - Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH - Pull request #1074 at e9a66c1: Gradient - commit 2024-16-12 - Pull request #1076 at 3bbd537: Allow depart early - Pull request #1085 at 37e2817: updates key commands for Train Operations window and also Daylight Offset - Pull request #1086 at e10390b: Add Settings Exporter tool (copy settings to INI, etc) - Pull request #1082 at 5845a1a: Allow variable water level in glass gauge - Pull request #1081 at 689494b: Brake cuts power unification
13 parents a6b9721 + 5522fc5 + 362e4e7 + bbc0013 + fb4a500 + f385422 + 1f5ba4c + e9a66c1 + 3bbd537 + 37e2817 + e10390b + 5845a1a + 689494b commit c1651fa

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Source/RunActivity/Viewer3D/Popups/HelpWindow.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,7 +1263,7 @@ private void AddAggregatedTrainInfo(Train playerTrain, ControlLayout scrollbox,
12631263
if (wag != null)
12641264
{
12651265
maxBrakeForceN += wag.MaxBrakeForceN;
1266-
var couplerStrength = GetMinCouplerStrenght(wag);
1266+
var couplerStrength = GetMinCouplerStrength(wag);
12671267
if (couplerStrength < lowestCouplerStrengthN) { lowestCouplerStrengthN = couplerStrength; }
12681268
var derailForce = GetDerailForce(wag);
12691269
if (derailForce < lowestDerailForceN) { lowestDerailForceN = derailForce; }
@@ -1386,12 +1386,15 @@ private void AddAggregatedTrainInfo(Train playerTrain, ControlLayout scrollbox,
13861386
/// <summary>
13871387
/// Get the lowest coupler strength for a car.
13881388
/// </summary>
1389-
private float GetMinCouplerStrenght(MSTSWagon wag)
1389+
private float GetMinCouplerStrength(MSTSWagon wag)
13901390
{
13911391
float couplerStrength = 1e10f; // default from TrainCar.GetCouplerBreak2N()
1392-
if (wag.Couplers.Count > 1 && wag.Couplers[1].Break2N < couplerStrength) { couplerStrength = wag.Couplers[1].Break2N; }
1393-
else if (wag.Couplers.Count > 0 && wag.Couplers[0].Break2N < couplerStrength) { couplerStrength = wag.Couplers[0].Break2N; }
1394-
if (couplerStrength < 99f) { couplerStrength = 1e10f; } // use default if near zero
1392+
foreach (var coupler in wag.Couplers)
1393+
{
1394+
// ignore unrealistically low values; some cars have Break2N lower than Break1N
1395+
if (coupler.Break1N > 99f && coupler.Break1N < couplerStrength) { couplerStrength = coupler.Break1N; }
1396+
if (coupler.Break2N > 99f && coupler.Break2N < couplerStrength) { couplerStrength = coupler.Break2N; }
1397+
}
13951398
return couplerStrength;
13961399
}
13971400

0 commit comments

Comments
 (0)