-
Notifications
You must be signed in to change notification settings - Fork 97
Temporary fix for bug 2121985: F9 TCO out-of-range after resume #1158
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?
Temporary fix for bug 2121985: F9 TCO out-of-range after resume #1158
Conversation
This is a temporary fix. It prevents writing an out of range index into the save file. As a comment it contains a better fix for the Window, but I could not come up with a simple fix for the Webpage.
| windowHeight = Vbox != null ? Vbox.Position.Height : 0; | ||
|
|
||
| // rwf-rr: part of debugging bug 2121985 | ||
| // System.Diagnostics.Debug.Assert(CarPosition < PlayerTrain.Cars.Count, "Viewer SelectedCar (index) out of range"); |
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.
I'm happy with the temporary fix including the comment saying as much, but please could we remove the commented-out debugging code
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.
Done.
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.
Thanks for fixing this, even temporarily, though we (ORMT) have decided not to take it for 1.6 as it does not appear to have a big enough impact
I have changed this PR to point to master so the fix can still be included in the Testing Version if desired, prior to a full fix being implemented
| // { | ||
| // SelectedCarPosition = CarPosition = Owner.Viewer.PlayerTrain.Cars.Count - 1; | ||
| // LastCarIDSelected = PlayerTrain.Cars[SelectedCarPosition].CarID; | ||
| // } |
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.
Looks like we still have this block.
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.
I left this one because it is a permanent fix for the F9 window. I wanted to keep a record of this option.
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.
@twpol I would like to leave this last comment in there, as it will guide a future permanent fix. Please let me know if you agree.
Bug 2121985 - it is present in 1.6-rc8
This is a temporary fix. It prevents writing an out of range index into the save file. As a comment it contains a better fix for the Window, but I could not come up with a simple fix for the Webpage.
The problem with the Web-Page happens when the Window is closed. Thus the web page cannot easily change state in the window.
For master, we will need a better fix. There are issues with the interaction between the Window and the Web-Page. Maybe have a separate state object and use the window and web-page objects for the UI parts only.