Skip to content

Commit 2f44c45

Browse files
authored
Merge pull request #471 from peternewell/control-trailer#1
Correct issue with control car wheels not rotating Blueprint https://blueprints.launchpad.net/or/+spec/unpowered-control-car
2 parents 1c391e5 + 58fb8cb commit 2f44c45

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Source/Orts.Simulation/Simulation/RollingStocks/MSTSControlTrailerCar.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ public override void InitializeMoving()
120120
public override void Update(float elapsedClockSeconds)
121121
{
122122
base.Update(elapsedClockSeconds);
123+
WheelSpeedMpS = SpeedMpS; // Set wheel speed for control car, required to make wheels go around.
123124

124125
}
125126

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2431,17 +2431,16 @@ public void AdvancedAdhesion(float elapsedClockSeconds)
24312431
}
24322432

24332433
//Curtius-Kniffler computation for the basic model
2434-
// float max0 = 1.0f; //Adhesion conditions [N]
2434+
// float max0 = 1.0f; //Adhesion conditions [N]
24352435

2436-
if (EngineType == EngineTypes.Steam && SteamEngineType != MSTSSteamLocomotive.SteamEngineTypes.Geared )
2437-
{
2436+
if (EngineType == EngineTypes.Steam && SteamEngineType != MSTSSteamLocomotive.SteamEngineTypes.Geared)
2437+
{
24382438
// Steam locomotive details updated in UpdateTractiveForce method, and inserted into adhesion module
24392439
// **************** NB WheelSpeed updated within Steam Locomotive module at the moment - to be fixed to prevent discrepancies ******************
24402440
}
2441-
2442-
else
2441+
else
24432442
{
2444-
2443+
24452444
//Compute axle inertia from parameters if possible
24462445
if (AxleInertiaKgm2 > 10000.0f) // if axleinertia value supplied in ENG file, then use in calculations
24472446
{
@@ -2476,7 +2475,7 @@ public void AdvancedAdhesion(float elapsedClockSeconds)
24762475
LocomotiveAxle.DriveForceN = MotiveForceN; //Total force applied to wheels
24772476
LocomotiveAxle.TrainSpeedMpS = SpeedMpS; //Set the train speed of the axle model
24782477
LocomotiveAxle.Update(elapsedClockSeconds); //Main updater of the axle model
2479-
2478+
24802479
// Output
24812480
MotiveForceN = LocomotiveAxle.CompensatedAxleForceN; //Get the Axle force and use it for the motion (use compensated value as it is independent of brake force)
24822481

0 commit comments

Comments
 (0)