Skip to content

Commit 8cbc503

Browse files
committed
Disable braking wheel skid for rack railway stock
1 parent 5f708ca commit 8cbc503

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1595,6 +1595,11 @@ public override void Initialize()
15951595
Trace.TraceInformation("LocomotiveRailDriveType set to Default value of {0}", LocomotiveRailDriveType);
15961596
}
15971597

1598+
if (LocomotiveRailDriveType == LocomotiveRailDriveTypes.Rack)
1599+
{
1600+
CogWheelFitted = true;
1601+
}
1602+
15981603
SteamHeatPressureToTemperaturePSItoF = SteamTable.SteamHeatPressureToTemperatureInterpolatorPSItoF();
15991604
SteamDensityPSItoLBpFT3 = SteamTable.SteamDensityInterpolatorPSItoLBpFT3();
16001605
SteamHeatPSItoBTUpLB = SteamTable.SteamHeatInterpolatorPSItoBTUpLB();
@@ -1603,7 +1608,7 @@ public override void Initialize()
16031608
if (WaterScoopFillElevationM == 0)
16041609
{
16051610
WaterScoopFillElevationM = 2.7432f; // Set to default of 9 ft
1606-
}
1611+
}
16071612

16081613
if (WaterScoopDepthM == 0)
16091614
{
@@ -1616,7 +1621,7 @@ public override void Initialize()
16161621
}
16171622

16181623
// Check if current sander has been set
1619-
if (CurrentTrackSandBoxCapacityM3 == 0 )
1624+
if (CurrentTrackSandBoxCapacityM3 == 0)
16201625
{
16211626
CurrentTrackSandBoxCapacityM3 = MaxTrackSandBoxCapacityM3;
16221627
}
@@ -1626,7 +1631,7 @@ public override void Initialize()
16261631
{
16271632
if (MSTSLocoNumDrvWheels != 0 && MSTSLocoNumDrvWheels < 7)
16281633
{
1629-
LocoNumDrvAxles = (int) MSTSLocoNumDrvWheels;
1634+
LocoNumDrvAxles = (int)MSTSLocoNumDrvWheels;
16301635
}
16311636
else
16321637
{
@@ -1717,7 +1722,7 @@ public override void Initialize()
17171722
BrakePipeDischargeTimeFactor = 1.5f; // Air brakes
17181723
}
17191724
}
1720-
1725+
17211726
// Initialise the resistance of the vacuum pump
17221727
if (VacuumPumpResistanceN == 0)
17231728
{

Source/Orts.Simulation/Simulation/RollingStocks/MSTSWagon.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ public enum WindowState
101101
public bool IsDavisFriction = true; // Default to new Davis type friction
102102
public bool IsBelowMergeSpeed = true; // set indicator for low speed operation as per given speed
103103

104-
105104
public bool GenericItem1;
106105
public bool GenericItem2;
107106

@@ -1549,8 +1548,10 @@ public virtual void Parse(string lowercasetoken, STFReader stf)
15491548
Couplers[CouplerCountLocation].Rigid = false;
15501549
Couplers[CouplerCountLocation].Rigid = stf.ReadBoolBlock(true);
15511550
break;
1552-
15531551

1552+
case "wagon(ortscogwheel":
1553+
CogWheelFitted = stf.ReadBoolBlock(false);
1554+
break;
15541555

15551556
case "wagon(adheasion":
15561557
stf.MustMatch("(");
@@ -1756,6 +1757,7 @@ public virtual void Copy(MSTSWagon copy)
17561757
Curtius_KnifflerB = copy.Curtius_KnifflerB;
17571758
Curtius_KnifflerC = copy.Curtius_KnifflerC;
17581759
AdhesionK = copy.AdhesionK;
1760+
CogWheelFitted = copy.CogWheelFitted;
17591761
AxleInertiaKgm2 = copy.AxleInertiaKgm2;
17601762
SlipWarningThresholdPercent = copy.SlipWarningThresholdPercent;
17611763
Lights = copy.Lights;

Source/Orts.Simulation/Simulation/RollingStocks/TrainCar.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,8 @@ public Direction Direction
597597
public float BrakeShoeForceN;
598598
public float FrictionBrakeBlendingMaxForceN; // This is the maximum force for the friction barke when it is blended with the dynamic brake
599599

600+
public bool CogWheelFitted = false;
601+
600602
// Sum of all the forces acting on a Traincar in the direction of driving.
601603
// MotiveForceN and GravityForceN act to accelerate the train. The others act to brake the train.
602604
public float TotalForceN; //
@@ -1099,7 +1101,8 @@ public virtual void UpdateBrakeSlideCalculation()
10991101
{
11001102

11011103
// Only apply slide, and advanced brake friction, if advanced adhesion is selected, simplecontrolphysics is not set, and it is a Player train
1102-
if (Simulator.UseAdvancedAdhesion && !Simulator.Settings.SimpleControlPhysics && IsPlayerTrain)
1104+
// Rack stock with cog wheel fitted will not skid
1105+
if (Simulator.UseAdvancedAdhesion && !Simulator.Settings.SimpleControlPhysics && IsPlayerTrain && !CogWheelFitted)
11031106
{
11041107

11051108
// ************ Check if diesel or electric - assumed already be cover by advanced adhesion model *********

0 commit comments

Comments
 (0)