diff --git a/src/Devices/AtcDimetronic.cs b/src/Devices/AtcDimetronic.cs index 09c778f..a5fefab 100644 --- a/src/Devices/AtcDimetronic.cs +++ b/src/Devices/AtcDimetronic.cs @@ -464,6 +464,7 @@ namespace OpenbveFcmbTrainPlugin if (train.PhysicalHandles.Reverser == 1 && TrackState > TrackStates.Unprotected) { DeviceState = DeviceStates.ATP; + AtcControlState = AtcControlStates.Released; } } } @@ -724,6 +725,13 @@ namespace OpenbveFcmbTrainPlugin requiredDeceleration = (train.State.Speed.MetersPerSecond - target.MetersPerSecond) / (distance - 8) * 10; } + // Calculate time needed to reach target speed + double requiredDecelerationSeconds = 0; + if (target.KilometersPerHour < limit.KilometersPerHour) + { + requiredDecelerationSeconds = (target.MetersPerSecond - limit.MetersPerSecond) / -AtoDeceleration; + } + // Pitch multiplier, used to alter when state changes occur double pitchMulti = train.State.Pitch / 20;