Skip to content

Commit 7111749

Browse files
committed
Automatic merge of T1.6-145-g7915033ac and 11 pull requests
- Pull request #1082 at 8538170: Allow variable water level in glass gauge - Pull request #1156 at f46d5f2: Fix incorrectly disabled options in train operations window - Pull request #570 at 1b6b22e: glTF 2.0 support with PBR lighting - Pull request #1091 at 492795a: Automatic speed control - Pull request #1122 at 73c47b4: Wagon Size and Centering Controls - Pull request #1124 at e241a0d: Built-in PBL2 brake controller - Pull request #1157 at 39cd994: Dynamic brake authorization by TCS - Pull request #1167 at 115325f: Fix: RunActivity slow to terminate because of long sleep in Host Process - Pull request #1168 at 6e2942f: Fix exception when exiting with MapForm or SoundDebugForm open. - Pull request #1169 at a984e3f: Better Handling of Wagons with Invalid Bogie Configuration - Pull request #1171 at 8fd2066: no internet connection is available, not possible to open the Menu Content Form
13 parents b8c230a + 7915033 + 8538170 + f46d5f2 + 1b6b22e + 492795a + 73c47b4 + e241a0d + 39cd994 + 115325f + 6e2942f + a984e3f + 8fd2066 commit 7111749

File tree

1 file changed

+4
-1
lines changed
  • Source/Orts.Simulation/Simulation/RollingStocks

1 file changed

+4
-1
lines changed

Source/Orts.Simulation/Simulation/RollingStocks/TrainCar.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3039,7 +3039,7 @@ public void ComputePosition(Traveller traveler, bool backToFront, float elapsedT
30393039
if (p.SumWgt > 1.5f)
30403040
p0.AddPartLocation(1, p);
30413041
}
3042-
if (Parts.Count == 2)
3042+
if (Parts.Count == 2 && p0.SumWgt < 1.5f)
30433043
{
30443044
// Train car lacks sufficient parts to locate using linear regression
30453045
p0.Dir = Parts[1].Dir;
@@ -3856,7 +3856,10 @@ public void FindCenterLine()
38563856
else // Improperly defined wagon, fallback to basic calculation
38573857
{
38583858
for (int i = 0; i < 3; i++)
3859+
{
38593860
Pos[i] = (float)(SumPos[i] / SumWgt);
3861+
Dir[i] = 0;
3862+
}
38603863
}
38613864

38623865
Roll = SumRoll / (float)SumWgt;

0 commit comments

Comments
 (0)