Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lights Bugfixes #926

Merged
merged 2 commits into from Mar 17, 2024
Merged

Lights Bugfixes #926

merged 2 commits into from Mar 17, 2024

Conversation

SteelFill
Copy link
Contributor

Follow up to PR #917 to fix some edge cases that could result in null references.

Bug was reported here on Elvas Tower

  • Add check if lead locomotive is null, which may happen on AI trains where there's no locomotive at the front
  • Add check if Train is null to reverser condition, I'm not sure why this would happen but I did get it to happen
  • And made some comparisons use nullable references so they won't die upon a null reference, but return false instead

twpol pushed a commit that referenced this pull request Mar 16, 2024
- 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 1a5693d: Blueprint/train car operations UI window
- Pull request #885 at d714b11: 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 #903 at 29f3d1a: Downloading route content (Github, zip)
- Pull request #912 at f7b85e4: New Triple Valve Features Vol. 2
- Pull request #919 at 1a376fa: Added mouse wheel support for controls which can be moved by pressing t…
- Pull request #923 at e0f3c55: Add curve squeal to route
- Pull request #924 at 6c2c3cd: Default Asset Improvements
- Pull request #925 at e3b1688: Fix brakeshoe force bug
- Pull request #926 at 729e0b7: Lights Bugfixes
@SteelFill SteelFill added the bug Something isn't working label Mar 16, 2024
Copy link
Contributor

@Csantucci Csantucci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should check about Train == null also lines computing newCarIsFirst and newCarIsLast

twpol pushed a commit that referenced this pull request Mar 16, 2024
- 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 3ca0eb1: Blueprint/train car operations UI window
- Pull request #885 at d714b11: 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 #903 at 29f3d1a: Downloading route content (Github, zip)
- Pull request #912 at f7b85e4: New Triple Valve Features Vol. 2
- Pull request #919 at 1a376fa: Added mouse wheel support for controls which can be moved by pressing t…
- Pull request #923 at e0f3c55: Add curve squeal to route
- Pull request #924 at 6c2c3cd: Default Asset Improvements
- Pull request #925 at e3b1688: Fix brakeshoe force bug
- Pull request #926 at 729e0b7: Lights Bugfixes
@SteelFill
Copy link
Contributor Author

You should check about Train == null also lines computing newCarIsFirst and newCarIsLast

That looks weird but still works because of operator precedence and short-circuiting. I don't know why the original code did that though, definitely not intuitive.

twpol pushed a commit that referenced this pull request Mar 16, 2024
- 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 3ca0eb1: Blueprint/train car operations UI window
- Pull request #885 at d714b11: 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 #903 at 29f3d1a: Downloading route content (Github, zip)
- Pull request #912 at f7b85e4: New Triple Valve Features Vol. 2
- Pull request #919 at 1a376fa: Added mouse wheel support for controls which can be moved by pressing t…
- Pull request #923 at e0f3c55: Add curve squeal to route
- Pull request #924 at 6c2c3cd: Default Asset Improvements
- Pull request #925 at e3b1688: Fix brakeshoe force bug
- Pull request #926 at b20ca94: Lights Bugfixes
twpol pushed a commit that referenced this pull request Mar 17, 2024
- 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 3ca0eb1: Blueprint/train car operations UI window
- Pull request #885 at d714b11: 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 #903 at 29f3d1a: Downloading route content (Github, zip)
- Pull request #912 at f7b85e4: New Triple Valve Features Vol. 2
- Pull request #919 at 26cc6a8: Added mouse wheel support for controls which can be moved by pressing t…
- Pull request #923 at e0f3c55: Add curve squeal to route
- Pull request #924 at 6c2c3cd: Default Asset Improvements
- Pull request #925 at e3b1688: Fix brakeshoe force bug
- Pull request #926 at b20ca94: Lights Bugfixes
Copy link
Contributor

@Csantucci Csantucci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's OK now for me

twpol pushed a commit that referenced this pull request Mar 17, 2024
- 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 3ca0eb1: Blueprint/train car operations UI window
- Pull request #885 at 753cba5: 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 #903 at 29f3d1a: Downloading route content (Github, zip)
- Pull request #912 at f7b85e4: New Triple Valve Features Vol. 2
- Pull request #919 at 26cc6a8: Added mouse wheel support for controls which can be moved by pressing t…
- Pull request #923 at e0f3c55: Add curve squeal to route
- Pull request #924 at 6c2c3cd: Default Asset Improvements
- Pull request #925 at e3b1688: Fix brakeshoe force bug
- Pull request #926 at b20ca94: Lights Bugfixes
twpol pushed a commit that referenced this pull request Mar 17, 2024
- 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 3ca0eb1: Blueprint/train car operations UI window
- Pull request #885 at 68029a6: 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 #903 at 29f3d1a: Downloading route content (Github, zip)
- Pull request #912 at f7b85e4: New Triple Valve Features Vol. 2
- Pull request #919 at 26cc6a8: Added mouse wheel support for controls which can be moved by pressing t…
- Pull request #923 at e0f3c55: Add curve squeal to route
- Pull request #924 at 6c2c3cd: Default Asset Improvements
- Pull request #925 at e3b1688: Fix brakeshoe force bug
- Pull request #926 at b20ca94: Lights Bugfixes
@SteelFill SteelFill merged commit 0a17d98 into openrails:master Mar 17, 2024
3 checks passed
@SteelFill SteelFill deleted the lights_bugfix branch March 17, 2024 21:24
@SteelFill SteelFill restored the lights_bugfix branch May 5, 2024 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
2 participants