Skip to content

Commit d5b0fd9

Browse files
committed
Automatic merge of T1.5.1-1201-g5d239654f2 and 18 pull requests
- Pull request #799 at dfc715e: Consolidated wind simulation - Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters - Pull request #885 at 8f473ce: feat: Add notifications to Menu - Pull request #891 at 9a1d6b2: Auto save - Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH - Pull request #952 at 8347095: Investigation - Pulsing graphics - Pull request #953 at a519452: Fix Lights Crash on Corrupt Shapes - Pull request #954 at e715fa4: Multiple Track Profiles & Superelevation Improvements - Pull request #962 at 46d0472: Fix pantographs on unpowered cars - Pull request #972 at e90a2aa: On Map window color changed switch or signal is not changed - Pull request #980 at a7406de: Downloading route content (Github, zip) second part - Pull request #981 at ef9b55d: Multiple type trainset lightglows - Pull request #982 at efcf19c: WEB based Switch Panel enhancement: Alerter - Pull request #983 at 202316e: WEB based Switch Panel bug: DPU window - Pull request #984 at 0f8122e: Player train switching for timetable mode - Pull request #985 at 4f42995: Correct bug with steam locomotive chuffing sound - Pull request #900 at c27f32d: DMI updates - Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder
20 parents 29f335d + 5d23965 + dfc715e + d00beb9 + 8f473ce + 9a1d6b2 + 1f5ba4c + 8347095 + a519452 + e715fa4 + 46d0472 + e90a2aa + a7406de + ef9b55d + efcf19c + 202316e + 0f8122e + 4f42995 + c27f32d + f92de76 commit d5b0fd9

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

Source/Orts.Simulation/Simulation/RollingStocks/MSTSSteamLocomotive.cs

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3503,13 +3503,26 @@ 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+
if (SteamEngines[i].AttachedAxle.IsWheelSlip)
3509+
{
3510+
variable[i] = Math.Abs(SteamEngines[i].AttachedAxle.SlipSpeedMpS / SteamEngines[i].AttachedAxle.WheelRadiusM / MathHelper.Pi * 5);
3511+
}
3512+
else
3513+
{
3514+
variable[i] = Math.Abs((float)SteamEngines[i].AttachedAxle.AxleSpeedMpS / SteamEngines[i].AttachedAxle.WheelRadiusM / MathHelper.Pi * 5);
3515+
}
35093516
}
3510-
else
3517+
else
3518+
// 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
35113519
{
3512-
variable[i] = Math.Abs((float)SteamEngines[i].AttachedAxle.AxleSpeedMpS / SteamEngines[i].AttachedAxle.WheelRadiusM / MathHelper.Pi * 5);
3520+
if (WheelSlip)
3521+
variable[i] = Math.Abs(WheelSpeedSlipMpS / SteamEngines[0].AttachedAxle.WheelRadiusM / MathHelper.Pi * 5);
3522+
else
3523+
{
3524+
variable[i] = Math.Abs(WheelSpeedMpS / SteamEngines[0].AttachedAxle.WheelRadiusM / MathHelper.Pi * 5);
3525+
}
35133526
}
35143527

35153528
variable[i] = ThrottlePercent == 0 ? 0 : variable[i];

0 commit comments

Comments
 (0)