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

_current_company is used indirectly from the GUI via NewGRFs #3804

Closed
DorpsGek opened this issue May 1, 2010 · 1 comment
Closed

_current_company is used indirectly from the GUI via NewGRFs #3804

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

Comments

@DorpsGek
Copy link
Member

DorpsGek commented May 1, 2010

frosch opened the ticket and wrote:

There are some functions in src/newgrf_*.cpp which use _current_company if there is no specific objects whose owner can be used. E.g. when querying stuff for the purchase list.
These functions are called from the GUI, the AIs and also from the commands, so using _local_company is wrong as well.

_current_company is set to _local_company on various user interactions, e.g. when clicking with the mouse or hitting keys. In other cases (e.g. when renaming a town) it is set to spectator. So if e.g. purchase lists are drawn after such a command but before the next mouse click the queried information is wrong.

Maybe _current_company should just get assigned to _local_company during any GUI stuff.

Reported version: trunk
Operating system: All


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

DorpsGek commented Jun 5, 2010

frosch closed the ticket.

Reason for closing: Fixed

in r19933


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

@DorpsGek DorpsGek closed this as completed Jun 5, 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