Skip to content

Commit c17fdb3

Browse files
committed
Add booster gear time delay
1 parent 6b0731c commit c17fdb3

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

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

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ public class MSTSSteamLocomotive : MSTSLocomotive
133133
public bool SteamBoosterRunMode = false;
134134
public bool SteamBoosterIdleMode = false;
135135
public bool SteamBoosterLatchedLocked = false;
136+
float BoosterGearEngageTimeS;
137+
float BoosterIdleTimeS;
138+
float BoosterGearEngageTimeStartS;
136139
public float HuDBoosterSteamConsumptionLbpS;
137140
public float BoosterSteamConsumptionLbpS;
138141
float BoosterIdleChokeSizeIn;
@@ -2237,19 +2240,26 @@ public override void Update(float elapsedClockSeconds)
22372240
SteamBoosterRunMode = false;
22382241
SteamBoosterIdleMode = true;
22392242
enginethrottle = 0.0f;
2243+
BoosterGearEngageTimeS = 0;
22402244
}
22412245
// Run mode
22422246
else if (SteamBoosterAirOpen && SteamBoosterIdle && SteamBoosterLatchedLocked)
22432247
{
2244-
SteamBoosterIdleMode = false;
2245-
SteamBoosterRunMode = true;
2246-
enginethrottle = throttle;
2248+
if (BoosterGearEngageTimeS > 6)
2249+
{
2250+
SteamBoosterIdleMode = false;
2251+
SteamBoosterRunMode = true;
2252+
enginethrottle = throttle;
2253+
}
2254+
BoosterGearEngageTimeS += elapsedClockSeconds;
22472255
}
2248-
else if (!SteamBoosterAirOpen || !SteamBoosterLatchedLocked)
2256+
else if (!SteamBoosterAirOpen || !SteamBoosterLatchedLocked) // Turn Booster off completely
22492257
{
22502258
SteamBoosterRunMode = false;
22512259
SteamBoosterIdleMode = false;
22522260
enginethrottle = 0;
2261+
BoosterGearEngageTimeS = 0;
2262+
BoosterIdleTimeS = 0;
22532263
}
22542264

22552265
UpdateCylinders(elapsedClockSeconds, enginethrottle, boostercutoff, absSpeedMpS, i);

0 commit comments

Comments
 (0)