File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Source/Orts.Simulation/Simulation/RollingStocks Expand file tree Collapse file tree 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)
35033503 // Variable is proportional to angular speed, value of 10 means 1 rotation/second.
35043504 // If wheel is not slipping then use normal wheel speed, this reduces oscillations in variable1 which causes issues with sounds.
35053505
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) )
35073507 {
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);
35093509 }
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
35113512 {
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+ }
35133519 }
35143520
35153521 variable[i] = ThrottlePercent == 0 ? 0 : variable[i];
You can’t perform that action at this time.
0 commit comments