diff --git a/Source/Orts.Simulation/Simulation/RollingStocks/MSTSControlTrailerCar.cs b/Source/Orts.Simulation/Simulation/RollingStocks/MSTSControlTrailerCar.cs index 611842aad..eb541240b 100644 --- a/Source/Orts.Simulation/Simulation/RollingStocks/MSTSControlTrailerCar.cs +++ b/Source/Orts.Simulation/Simulation/RollingStocks/MSTSControlTrailerCar.cs @@ -41,7 +41,7 @@ namespace Orts.Simulation.RollingStocks { public class MSTSControlTrailerCar : MSTSLocomotive { - public int ControllerNumberOfGears = 1; + public int ControllerNumberOfGears = 0; bool HasGearController = false; bool ControlGearUp = false; bool ControlGearDown = false; @@ -174,7 +174,7 @@ public override void Update(float elapsedClockSeconds) { var locog = car as MSTSDieselLocomotive; - if (locog != null && car != this && !locog.IsLeadLocomotive() && (ControlGearDown || ControlGearUp)) + if (locog != null && locog.DieselEngines[0].GearBox != null && locog.DieselEngines[0].GearBox != null && car != this && !locog.IsLeadLocomotive() && (ControlGearDown || ControlGearUp)) { if (ControlGearUp) { @@ -194,7 +194,7 @@ public override void Update(float elapsedClockSeconds) } // Read values for the HuD and other requirements, will be based upon the last motorcar - if (locog != null) + if (locog != null && locog.DieselEngines[0].GearBox != null && locog.DieselEngines[0].GearBox != null) { ControlGearIndex = locog.DieselEngines[0].GearBox.CurrentGearIndex; ControlGearIndication = locog.DieselEngines[0].GearBox.GearIndication;