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

-Fix (r20772): use correct company name for group window title. #4148

Closed
DorpsGek opened this issue Oct 3, 2010 · 1 comment
Closed

-Fix (r20772): use correct company name for group window title. #4148

DorpsGek opened this issue Oct 3, 2010 · 1 comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

DorpsGek commented Oct 3, 2010

sbr opened the ticket and wrote:

Before the introduction of VehicleListIdentifier, the window owner was extracted from window_number ('GB(this->window_number, 0, 8)') in the group GUI. This was used in the constructor but also in the 'SetStringParameters(int)' method to set the window title.

The 'SetStringParameters(int)' method wasn't updated in r20772 and always try to get the owner from the window number. This results in, other than first, companies having group GUI title set to the first company name. Also crashing the game when the first company gone bankrupt and therefore doesn't exists anymore.

The owner could be obtained from 'this->owner' or 'this->vli.company'. As 'SetStringParameters(int)' is first called during 'FinishInitNested(WindowDesc, WindowNumber)', that is when 'this->owner' isn't set (cf. r20781), 'this->vli.company' should be used to reliably obtain the owner of the window.

Please find attached a patch against r20890.

Attachments

Reported version: trunk
Operating system: All


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

DorpsGek commented Oct 3, 2010

Rubidium closed the ticket.

Reason for closing: Fixed

In r20894. Thanks for the patch.


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

@DorpsGek DorpsGek closed this as completed Oct 3, 2010
@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