Skip to content

Commit 8b5c27f

Browse files
committed
Fix incorrect usage of target force instead of max force
1 parent 455e011 commit 8b5c27f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Source/Orts.Simulation/Simulation/RollingStocks/MSTSLocomotive.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2626,7 +2626,7 @@ protected virtual void UpdateTractionForce(float elapsedClockSeconds)
26262626
if (LocomotivePowerSupply is ScriptedLocomotivePowerSupply supply)
26272627
{
26282628
float maxPowerW = supply.AvailableTractionPowerW;
2629-
if (targetForceN * AbsTractionSpeedMpS > maxPowerW) maxForceN = maxPowerW / AbsTractionSpeedMpS;
2629+
if (maxForceN * AbsTractionSpeedMpS > maxPowerW) maxForceN = maxPowerW / AbsTractionSpeedMpS;
26302630
}
26312631
UpdateForceWithRamp(ref TractionForceN, elapsedClockSeconds, targetForceN, maxForceN, TractionForceRampUpNpS, TractionForceRampDownNpS, TractionForceRampDownToZeroNpS, TractionPowerRampUpWpS, TractionPowerRampDownWpS, TractionPowerRampDownToZeroWpS);
26322632
}

0 commit comments

Comments
 (0)