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

[Bug]: setting_newgame console commands trigger post_cb callbacks which implicitly assume settings #12059

Open
JGRennison opened this issue Feb 11, 2024 · 2 comments

Comments

@JGRennison
Copy link
Contributor

Version of OpenTTD

master

Expected result

Use of the setting_newgame console command shouldn't effect changes as if the active settings were changed.

Actual result

Many of the post_cb implementations use a comparison between _game_mode and GM_MENU to decide whether the change should be effected on the running game and/or on _settings.

Use of setting_newgame as a multiplayer client can cause multiplayer desyncs or other state divergences.

Steps to reproduce

Use the setting_newgame console command.
Ones with interesting effects include: economy.minutes_per_calendar_year, service interval settings and freeform_edges.

@TrueBrain
Copy link
Member

I never really understood why setting_newgame exists, but should it even be allowed in Multiplayer?

@JGRennison
Copy link
Contributor Author

In principle you should be able to use it at any time because it should never affect the running game.
However I also doubt that this is used much or is really necessary.

JGRennison added a commit to JGRennison/Upstream-OpenTTD that referenced this issue Feb 12, 2024
Remove now unused force_newgame parameters

Fixes: OpenTTD#12059
JGRennison added a commit to JGRennison/OpenTTD-patches that referenced this issue Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants