Skip to content

Commit a984e3f

Browse files
committed
Support rigid frame rolling stock
1 parent 8fe03b1 commit a984e3f

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
@@ -3020,7 +3020,7 @@ public void ComputePosition(Traveller traveler, bool backToFront, float elapsedT
30203020
if (p.SumWgt > 1.5f)
30213021
p0.AddPartLocation(1, p);
30223022
}
3023-
if (Parts.Count == 2)
3023+
if (Parts.Count == 2 && p0.SumWgt < 1.5f)
30243024
{
30253025
// Train car lacks sufficient parts to locate using linear regression
30263026
p0.Dir = Parts[1].Dir;
@@ -3837,7 +3837,10 @@ public void FindCenterLine()
38373837
else // Improperly defined wagon, fallback to basic calculation
38383838
{
38393839
for (int i = 0; i < 3; i++)
3840+
{
38403841
Pos[i] = (float)(SumPos[i] / SumWgt);
3842+
Dir[i] = 0;
3843+
}
38413844
}
38423845

38433846
Roll = SumRoll / (float)SumWgt;

0 commit comments

Comments
 (0)