diff --git a/src/Devices/AtcBombardier.cs b/src/Devices/AtcBombardier.cs index f399635..f988743 100644 --- a/src/Devices/AtcBombardier.cs +++ b/src/Devices/AtcBombardier.cs @@ -58,25 +58,25 @@ namespace OpenbveFcmbTrainPlugin private TrackStates TrackState; /// The time needed by the ATC device to initialize, in seconds. - private readonly double InitializationTime; + private double InitializationTime; /// A counter to keep track of initialization time, in seconds. private double InitializationCounter; /// The blinking time for lamps, in milliseconds. - private readonly double BlinkTime; + private double BlinkTime; /// A counter to keep track of blink time, in milliseconds. private double BlinkCounter; /// The time after which YARD mode enters idle state and engages the service brake, in seconds. - private readonly double YardIdleTime; + private double YardIdleTime; /// A counter to keep track of YARD mode idle time, in seconds. private double YardIdleCounter; /// The maximum speed in YARD mode, in km/h. - private readonly double YardMaximumSpeed; + private double YardMaximumSpeed; /// Represents an ATC movement permission order. private class MovementPermission diff --git a/src/Devices/AtcDimetronic.cs b/src/Devices/AtcDimetronic.cs index ae59c1d..3f834f8 100644 --- a/src/Devices/AtcDimetronic.cs +++ b/src/Devices/AtcDimetronic.cs @@ -50,7 +50,7 @@ namespace OpenbveFcmbTrainPlugin private TrackStates TrackState; /// The maximum speed in YARD mode, in km/h. - private readonly double YardMaximumSpeed; + private double YardMaximumSpeed; /// Represents an ATC speed code. private class SpeedCode diff --git a/src/Devices/Deadman.cs b/src/Devices/Deadman.cs index 5800cda..13cb93a 100644 --- a/src/Devices/Deadman.cs +++ b/src/Devices/Deadman.cs @@ -24,10 +24,10 @@ namespace OpenbveFcmbTrainPlugin private double Counter; /// The delay time until the service brake is applied, in seconds. - private readonly double BrakeDelay = 5.0; + private double BrakeDelay = 5.0; /// Whether the train must be completely stopped to release the brakes. - private readonly bool FullReset; + private bool FullReset; /// Creates an instance of the Deadman device. /// The delay before the brakes are applied, in seconds. diff --git a/src/Devices/DoorClosingSound.cs b/src/Devices/DoorClosingSound.cs index eb13768..e3b5527 100644 --- a/src/Devices/DoorClosingSound.cs +++ b/src/Devices/DoorClosingSound.cs @@ -118,18 +118,11 @@ namespace OpenbveFcmbTrainPlugin // Use departure time - door closing sound duration AiTriggerDoorClosingSound |= CurrentTime.Seconds >= route.CurrentStation.DepartureTime - DoorClosingSoundDuration; } + // TODO: AI gets stuck if doors open between stations, check distance to stop point } else { - // The doors have been opened between stations - if (route.CurrentStation.StopPosition - route.CurrentStation.BackwardTolerance > train.State.Location) - { - AiTriggerDoorClosingSound = true; - } - else - { - AiTriggerDoorClosingSound = false; - } + AiTriggerDoorClosingSound = false; } } else @@ -173,10 +166,6 @@ namespace OpenbveFcmbTrainPlugin { DoorOpenTime = CurrentTime; } - - // Set door closing counter to value higher than maximum where doors are allowed to close - // This effectively locks the doors when they open - DoorClosingSoundCounter = DoorClosingSoundDuration + DoorClosingSoundTimeout; } /// Is called when the device should perform the AI.