Skip to content

Commit eae6246

Browse files
CsantuccicesarBLG
andauthored
Update Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/PowerSupplies/DieselEngine.cs
I have also tested it, and it works Co-authored-by: César Benito Lamata <[email protected]>
1 parent 98f1c45 commit eae6246

File tree

1 file changed

+6
-1
lines changed
  • Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/PowerSupplies

1 file changed

+6
-1
lines changed

Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/PowerSupplies/DieselEngine.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,12 @@ public void InitializeMoving()
10141014
{
10151015
RealRPM = IdleRPM;
10161016
State = DieselEngineState.Running;
1017-
1017+
if (ThrottleRPMTab != null)
1018+
{
1019+
DemandedRPM = ThrottleRPMTab[Locomotive.ThrottlePercent];
1020+
DemandedRPM = MathHelper.Clamp(DemandedRPM, IdleRPM, MaxRPM); // Clamp throttle setting within bounds
1021+
RealRPM = DemandedRPM;
1022+
}
10181023
GearBox?.InitializeMoving();
10191024
}
10201025

0 commit comments

Comments
 (0)