Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@rwf-rr
Copy link
Contributor

@rwf-rr rwf-rr commented Sep 5, 2025

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.

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.
@rwf-rr rwf-rr requested review from mbm-OR and twpol September 5, 2025 00:33
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");
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@twpol twpol changed the base branch from release/1.6 to master September 7, 2025 18:09
Copy link
Member

@twpol twpol left a 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;
// }
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

@rwf-rr rwf-rr changed the title Temporary fix for bug 2121985: F9 TCO out-of-range after resume (release/1.6) Temporary fix for bug 2121985: F9 TCO out-of-range after resume Sep 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants