Skip to content

Conversation

@SteelFill
Copy link
Contributor

@SteelFill SteelFill commented Nov 2, 2025

As discussed on this Elvas Tower thread, part of the engine initialization process in GenericWAGFile.EngineClass expects the text "Engine (" in the .eng file to be immediately followed by another string, which is traditionally the name of the engine file, such as Engine ( Dash9. While this may have had some (unknown) purpose in MSTS, in OR the exact value of this string has no effect at all; the string is read but the value is discarded. We have no need to be told the file name repeatedly when we already know the file name!

Because the file name is not strictly required, some creators have elected to not include it. However, in this case, when GenericWAGFile.EngineClass is run OR will still read the next string after "Engine (" and will discard it, no matter what that string is. Normally this is fine, as GenericWAGFile is very barebones and won't be affected by a discarded string. EXCEPT, GenericWAGFile.EngineClass expects to parse the engine type by looking for the "type" token. If the "Engine (" text is immediately followed by "Type (", then the "type" string will be read and discarded, instead of being parsed. Then, when GenericWAGFile.EngineClass looks for the "type" token it will not be able to find it (as it's already been parsed), resulting in an error as the engine type is unknown.

The fix is incredibly simple: We remove the call to stf.ReadString(); in GenericWAGFile.EngineClass that is placed immediately after parsing "Engine (". Because the result of this read operation is ignored, this won't have any adverse effects. All that changes is that the parser will start searching for the "type" token immediately after "Engine (" instead of only looking for it after the second token. Whether or not the file name is read won't have any impact, so both MSTS and OR content can be loaded successfully.

[Not for 1.6.1]

@SteelFill SteelFill requested a review from rwf-rr November 2, 2025 19:20
@SteelFill SteelFill added the bug Something isn't working label Nov 2, 2025
Copy link
Contributor

@rwf-rr rwf-rr left a comment

Choose a reason for hiding this comment

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

Reviewed and tested.

@cjakeman
Copy link
Contributor

Hi Phillip,

This might be a good candidate for 1.6.1 as it's a confusing bug that will just create more confusion if we leave it in, and the fix is super tiny.

This is one of the PRs that ORMT considered for 1.6.1, but decided against. Principally because it's been in place for 13 years, so hardly a priority. The aim of 1.6.1 is to repair the bugs that cause the program to crash and we don't want to load it with trivial changes.

Best wishes,

Chris

Copy link
Contributor

@cjakeman cjakeman left a comment

Choose a reason for hiding this comment

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

This is a very small change, but it's also very recent so could we leave it in Unstable until it's had 3 weeks with no adverse comments, please?

Thanks,

Chris

@SteelFill
Copy link
Contributor Author

I have no intent to merge while unstable builds aren't building.

twpol pushed a commit that referenced this pull request Dec 9, 2025
- Pull request #1082 at a407e88: Allow variable water level in glass gauge
- Pull request #1057 at 85bde8e: Switchable brake system
- Pull request #1122 at 73c47b4: Wagon Size and Centering Controls
- Pull request #1124 at e241a0d: Built-in PBL2 brake controller
- Pull request #1128 at b6c197f: Particle Emitter Overhaul
- Pull request #1169 at 906f204: Revise TrainCar.SetUpWheels to Better Handle Unusual Rolling Stock
- Pull request #1175 at d28315e: Make Data Logger interval configurable
- Pull request #1176 at 4cd961b: Remove Implicit Requirement for Engine Name to Come After "Engine ("
- Pull request #1178 at 015769e: Fix Diesel RPM Rate of Change
twpol pushed a commit that referenced this pull request Dec 12, 2025
- Pull request #1082 at 1e9d30b: Allow variable water level in glass gauge
- Pull request #1057 at 85bde8e: Switchable brake system
- Pull request #1122 at 73c47b4: Wagon Size and Centering Controls
- Pull request #1124 at e241a0d: Built-in PBL2 brake controller
- Pull request #1128 at b6c197f: Particle Emitter Overhaul
- Pull request #1169 at 906f204: Revise TrainCar.SetUpWheels to Better Handle Unusual Rolling Stock
- Pull request #1175 at d28315e: Make Data Logger interval configurable
- Pull request #1176 at 4cd961b: Remove Implicit Requirement for Engine Name to Come After "Engine ("
- Pull request #1178 at 015769e: Fix Diesel RPM Rate of Change
twpol pushed a commit that referenced this pull request Dec 13, 2025
- Pull request #1082 at a0547a3: Allow variable water level in glass gauge
- Pull request #1057 at 85bde8e: Switchable brake system
- Pull request #1122 at 73c47b4: Wagon Size and Centering Controls
- Pull request #1124 at e241a0d: Built-in PBL2 brake controller
- Pull request #1128 at b6c197f: Particle Emitter Overhaul
- Pull request #1169 at 906f204: Revise TrainCar.SetUpWheels to Better Handle Unusual Rolling Stock
- Pull request #1175 at d28315e: Make Data Logger interval configurable
- Pull request #1176 at 4cd961b: Remove Implicit Requirement for Engine Name to Come After "Engine ("
- Pull request #1178 at 015769e: Fix Diesel RPM Rate of Change
twpol pushed a commit that referenced this pull request Dec 13, 2025
- Pull request #1082 at b191a54: Allow variable water level in glass gauge
- Pull request #1057 at 85bde8e: Switchable brake system
- Pull request #1122 at 73c47b4: Wagon Size and Centering Controls
- Pull request #1124 at e241a0d: Built-in PBL2 brake controller
- Pull request #1128 at b6c197f: Particle Emitter Overhaul
- Pull request #1169 at 906f204: Revise TrainCar.SetUpWheels to Better Handle Unusual Rolling Stock
- Pull request #1175 at d28315e: Make Data Logger interval configurable
- Pull request #1176 at 4cd961b: Remove Implicit Requirement for Engine Name to Come After "Engine ("
- Pull request #1178 at 015769e: Fix Diesel RPM Rate of Change
twpol pushed a commit that referenced this pull request Dec 15, 2025
- Pull request #1082 at b191a54: Allow variable water level in glass gauge
- Pull request #1057 at 85bde8e: Switchable brake system
- Pull request #1081 at a8127a1: Brake cuts power unification
- Pull request #1122 at 73c47b4: Wagon Size and Centering Controls
- Pull request #1124 at e241a0d: Built-in PBL2 brake controller
- Pull request #1128 at b6c197f: Particle Emitter Overhaul
- Pull request #1169 at 906f204: Revise TrainCar.SetUpWheels to Better Handle Unusual Rolling Stock
- Pull request #1175 at d28315e: Make Data Logger interval configurable
- Pull request #1176 at 4cd961b: Remove Implicit Requirement for Engine Name to Come After "Engine ("
- Pull request #1178 at 015769e: Fix Diesel RPM Rate of Change
twpol pushed a commit that referenced this pull request Dec 15, 2025
- Pull request #1082 at b191a54: Allow variable water level in glass gauge
- Pull request #1057 at 85bde8e: Switchable brake system
- Pull request #1081 at a8127a1: Brake cuts power unification
- Pull request #1091 at 378be55: Automatic speed control
- Pull request #1122 at 73c47b4: Wagon Size and Centering Controls
- Pull request #1124 at e241a0d: Built-in PBL2 brake controller
- Pull request #1128 at b6c197f: Particle Emitter Overhaul
- Pull request #1169 at 906f204: Revise TrainCar.SetUpWheels to Better Handle Unusual Rolling Stock
- Pull request #1175 at d28315e: Make Data Logger interval configurable
- Pull request #1176 at 4cd961b: Remove Implicit Requirement for Engine Name to Come After "Engine ("
- Pull request #1178 at 015769e: Fix Diesel RPM Rate of Change
twpol pushed a commit that referenced this pull request Dec 15, 2025
- Pull request #1082 at b191a54: Allow variable water level in glass gauge
- Pull request #1057 at 85bde8e: Switchable brake system
- Pull request #1081 at a8127a1: Brake cuts power unification
- Pull request #1091 at 378be55: Automatic speed control
- Pull request #1122 at 73c47b4: Wagon Size and Centering Controls
- Pull request #1124 at e241a0d: Built-in PBL2 brake controller
- Pull request #1128 at b6c197f: Particle Emitter Overhaul
- Pull request #1158 at 2599bfe: Temporary fix for bug 2121985: F9 TCO out-of-range after resume
- Pull request #1169 at 906f204: Revise TrainCar.SetUpWheels to Better Handle Unusual Rolling Stock
- Pull request #1175 at d28315e: Make Data Logger interval configurable
- Pull request #1176 at 4cd961b: Remove Implicit Requirement for Engine Name to Come After "Engine ("
- Pull request #1178 at 015769e: Fix Diesel RPM Rate of Change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Development

Successfully merging this pull request may close these issues.

3 participants