Skip to content

Commit 9f08bc0

Browse files
committed
Add TCS hooks to check for door state
1 parent 01de7b1 commit 9f08bc0

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Source/Orts.Simulation/Common/Scripting/TrainControlSystem.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,14 @@ public abstract class TrainControlSystem : AbstractTrainScriptClass
188188
/// </summary>
189189
public Func<bool> IsRearCab;
190190
/// <summary>
191+
/// True if left doors are open
192+
/// </summary>
193+
public Func<bool> AreLeftDoorsOpen;
194+
/// <summary>
195+
/// True if right doors are open
196+
/// </summary>
197+
public Func<bool> AreRightDoorsOpen;
198+
/// <summary>
191199
/// True if train brake controller is in emergency position, otherwise false.
192200
/// </summary>
193201
public Func<bool> IsBrakeEmergency;

Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/TrainControlSystem.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,8 @@ public void Initialize()
343343
Script.CurrentTrainMUDirection = () => Locomotive.Train.MUDirection; // Direction of train
344344
Script.IsFlipped = () => Locomotive.Flipped;
345345
Script.IsRearCab = () => Locomotive.UsingRearCab;
346+
Script.AreLeftDoorsOpen = () => Locomotive.DoorLeftOpen;
347+
Script.AreRightDoorsOpen = () => Locomotive.DoorRightOpen;
346348
Script.IsBrakeEmergency = () => Locomotive.TrainBrakeController.EmergencyBraking;
347349
Script.IsBrakeFullService = () => Locomotive.TrainBrakeController.TCSFullServiceBraking;
348350
Script.PowerAuthorization = () => PowerAuthorization;

0 commit comments

Comments
 (0)