File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/Brakes/MSTS Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 18
18
using ORTS . Common ;
19
19
using System ;
20
20
using System . Collections . Generic ;
21
+ using ORTS . Scripting . Api ;
21
22
22
23
namespace Orts . Simulation . RollingStocks . SubSystems . Brakes . MSTS
23
24
{
@@ -33,7 +34,9 @@ public EPBrakeSystem(TrainCar car)
33
34
public override void Update ( float elapsedClockSeconds )
34
35
{
35
36
MSTSLocomotive lead = ( MSTSLocomotive ) Car . Train . LeadLocomotive ;
36
- if ( lead != null && lead . BrakeSystem is EPBrakeSystem )
37
+
38
+ // Only allow brakes to operate if car is connected to an SME system
39
+ if ( lead != null && lead . BrakeSystem is EPBrakeSystem && Car . BrakeSystem is EPBrakeSystem && ( lead . TrainBrakeController . TrainBrakeControllerState == ControllerState . EPFullServ || lead . TrainBrakeController . TrainBrakeControllerState == ControllerState . EPOnly || lead . TrainBrakeController . TrainBrakeControllerState == ControllerState . EPApply ) )
37
40
{
38
41
39
42
float demandedAutoCylPressurePSI = 0 ;
Original file line number Diff line number Diff line change 18
18
using ORTS . Common ;
19
19
using System ;
20
20
using System . Collections . Generic ;
21
+ using ORTS . Scripting . Api ;
21
22
22
23
namespace Orts . Simulation . RollingStocks . SubSystems . Brakes . MSTS
23
24
{
@@ -33,7 +34,9 @@ public SMEBrakeSystem(TrainCar car)
33
34
public override void Update ( float elapsedClockSeconds )
34
35
{
35
36
MSTSLocomotive lead = ( MSTSLocomotive ) Car . Train . LeadLocomotive ;
36
- if ( lead != null && lead . BrakeSystem is SMEBrakeSystem )
37
+
38
+ // Only allow brakes to operate if car is connected to an SME system
39
+ if ( lead != null && lead . BrakeSystem is SMEBrakeSystem && Car . BrakeSystem is SMEBrakeSystem && ( lead . TrainBrakeController . TrainBrakeControllerState == ControllerState . SMEFullServ || lead . TrainBrakeController . TrainBrakeControllerState == ControllerState . SMEOnly || lead . TrainBrakeController . TrainBrakeControllerState == ControllerState . SMEReleaseStart || lead . TrainBrakeController . TrainBrakeControllerState == ControllerState . SMESelfLap ) )
37
40
{
38
41
39
42
float demandedAutoCylPressurePSI = 0 ;
You can’t perform that action at this time.
0 commit comments