File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Source/Orts.Simulation/Simulation/RollingStocks Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ namespace Orts.Simulation.RollingStocks
4141{
4242 public class MSTSControlTrailerCar : MSTSLocomotive
4343 {
44- public int ControllerNumberOfGears = 1 ;
44+ public int ControllerNumberOfGears = 0 ;
4545 bool HasGearController = false ;
4646 bool ControlGearUp = false ;
4747 bool ControlGearDown = false ;
@@ -174,7 +174,7 @@ public override void Update(float elapsedClockSeconds)
174174 {
175175 var locog = car as MSTSDieselLocomotive ;
176176
177- if ( locog != null && car != this && ! locog . IsLeadLocomotive ( ) && ( ControlGearDown || ControlGearUp ) )
177+ if ( locog != null && locog . DieselEngines [ 0 ] . GearBox != null && locog . DieselEngines [ 0 ] . GearBox != null && car != this && ! locog . IsLeadLocomotive ( ) && ( ControlGearDown || ControlGearUp ) )
178178 {
179179 if ( ControlGearUp )
180180 {
@@ -194,7 +194,7 @@ public override void Update(float elapsedClockSeconds)
194194 }
195195
196196 // Read values for the HuD and other requirements, will be based upon the last motorcar
197- if ( locog != null )
197+ if ( locog != null && locog . DieselEngines [ 0 ] . GearBox != null && locog . DieselEngines [ 0 ] . GearBox != null )
198198 {
199199 ControlGearIndex = locog . DieselEngines [ 0 ] . GearBox . CurrentGearIndex ;
200200 ControlGearIndication = locog . DieselEngines [ 0 ] . GearBox . GearIndication ;
You can’t perform that action at this time.
0 commit comments