File tree 1 file changed +10
-4
lines changed
Source/Orts.Simulation/Simulation/RollingStocks
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -3503,13 +3503,19 @@ private void UpdateFX(float elapsedClockSeconds)
3503
3503
// Variable is proportional to angular speed, value of 10 means 1 rotation/second.
3504
3504
// If wheel is not slipping then use normal wheel speed, this reduces oscillations in variable1 which causes issues with sounds.
3505
3505
3506
- if (SteamEngines[i].AttachedAxle.IsWheelSlip )
3506
+ if (((Train.TrainType == Train.TRAINTYPE.PLAYER && !Train.Autopilot) || Train.TrainType == Train.TRAINTYPE.AI_PLAYERDRIVEN) && (Simulator.UseAdvancedAdhesion && !Simulator.Settings.SimpleControlPhysics) )
3507
3507
{
3508
- variable[i] = Math.Abs(SteamEngines[i].AttachedAxle.SlipSpeedMpS / SteamEngines[i].AttachedAxle.WheelRadiusM / MathHelper.Pi * 5);
3508
+ variable[i] = Math.Abs((float) SteamEngines[i].AttachedAxle.AxleSpeedMpS / SteamEngines[i].AttachedAxle.WheelRadiusM / MathHelper.Pi * 5);
3509
3509
}
3510
- else
3510
+ else
3511
+ // Axle code is not executed if it is an AI train, on Autopilot, or Simple adhesion or simple physics is selected. Hence must use wheelspeed in these instances
3511
3512
{
3512
- variable[i] = Math.Abs((float)SteamEngines[i].AttachedAxle.AxleSpeedMpS / SteamEngines[i].AttachedAxle.WheelRadiusM / MathHelper.Pi * 5);
3513
+ if (WheelSlip)
3514
+ variable[i] = Math.Abs(WheelSpeedSlipMpS / SteamEngines[0].AttachedAxle.WheelRadiusM / MathHelper.Pi * 5);
3515
+ else
3516
+ {
3517
+ variable[i] = Math.Abs(WheelSpeedMpS / SteamEngines[0].AttachedAxle.WheelRadiusM / MathHelper.Pi * 5);
3518
+ }
3513
3519
}
3514
3520
3515
3521
variable[i] = ThrottlePercent == 0 ? 0 : variable[i];
You can’t perform that action at this time.
0 commit comments