-
Notifications
You must be signed in to change notification settings - Fork 98
Remove Implicit Requirement for Engine Name to Come After "Engine (" #1176
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
base: master
Are you sure you want to change the base?
Conversation
rwf-rr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed and tested.
|
Hi Phillip,
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 |
cjakeman
left a comment
There was a problem hiding this 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
|
I have no intent to merge while unstable builds aren't building. |
- 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
- 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
- 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
- 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
- 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
- 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
- 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
As discussed on this Elvas Tower thread, part of the engine initialization process in
GenericWAGFile.EngineClassexpects the text "Engine (" in the .eng file to be immediately followed by another string, which is traditionally the name of the engine file, such asEngine ( 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.EngineClassis run OR will still read the next string after "Engine (" and will discard it, no matter what that string is. Normally this is fine, asGenericWAGFileis very barebones and won't be affected by a discarded string. EXCEPT,GenericWAGFile.EngineClassexpects 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, whenGenericWAGFile.EngineClasslooks 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();inGenericWAGFile.EngineClassthat 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]