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

Dead code inside the NetworkGameWindow::OnInvalidateData #4482

Closed
DorpsGek opened this issue Feb 8, 2011 · 3 comments
Closed

Dead code inside the NetworkGameWindow::OnInvalidateData #4482

DorpsGek opened this issue Feb 8, 2011 · 3 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

DorpsGek commented Feb 8, 2011

adf88 opened the ticket and wrote:

In the NetworkGameWindow::OnInvalidateData there is a piece of dead code that will never be called.

There is a switch on the passed data and a case label "2" but NetworkGameWindow will never be invalidated with this code. The piece of dead code does exactly the same as the NetworkAfterNewGRFScan - it updates GRF information in the network game list.

The bug probably comes from bad understanding of ~NetworkContentDownloadStatusWindow destructor. The destructor calls ScanNewGRFFiles (indirectly NetworkAfterNewGRFScan) if there are new GRF files downloaded so the network game list WILL be notified and updated. At the end the destructor calls "InvalidateWindowData(WC_NETWORK_WINDOW, 1, 2);" which is misunderstood - that invalidation is directed to NetworkContentListWindow, not any other WC_NETWORK_WINDOW.

Fixpatch attached (r22021).

Attachments

Reported version: Version?
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/4482
@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 8, 2011

adf88 wrote:

And one more. This is not a full fix. The NetworkGameWindow should be invalidated to resort and redraw.


This comment was imported from FlySpray: https://bugs.openttd.org/task/4482#comment9627

@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 8, 2011

adf88 wrote:

Possible fix for above.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/4482#comment9628

@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 8, 2011

Rubidium closed the ticket.

Reason for closing: Fixed

In r22029/r22030


This comment was imported from FlySpray: https://bugs.openttd.org/task/4482

@DorpsGek DorpsGek closed this as completed Feb 8, 2011
@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant