Skip to content

Commit

Permalink
Automatic merge of T1.5.1-797-gabb8eb9a4 and 14 pull requests
Browse files Browse the repository at this point in the history
- Pull request #570 at 3539862: Experimental glTF 2.0 support with PBR lighting
- Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters
- Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder
- Pull request #882 at a055bca: Blueprint/train car operations UI window
- Pull request #885 at 8f94333: feat: Add notifications to Menu
- Pull request #886 at 6c0785b: Scene viewer extension to TrackViewer
- Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH
- Pull request #896 at 5866028: First implementation of https://blueprints.launchpad.net/or/+spec/specific-sounds-for-ai-trains
- Pull request #897 at 0a9d939: feat: Improved system information collection
- Pull request #899 at 28fe751: Duplex steam engines - Booster Engine addition
- Pull request #903 at 7353625: Downloading route content (Github, zip)
- Pull request #907 at 9b0b04f: Bug fix for https://bugs.launchpad.net/or/+bug/2047300 Dynamic tracks disappear after long tunnel
- Pull request #908 at 4b4afe3: feat: supports switching adhesion precisions
- Pull request #909 at c3a572a: Correct Control Car crash bug
  • Loading branch information
openrails-bot committed Jan 6, 2024
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
{
Expand All @@ -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;
Expand Down

0 comments on commit 40ac510

Please sign in to comment.