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: Do not unlock railtypes when enabling wagons with GameScript #9021

merged 1 commit into from Apr 17, 2021


Copy link

@ldpl ldpl commented Apr 11, 2021

Motivation / Problem

When enabling wagons with GS it also allowed their railtypes to be built which conflicted with how it's done in other places, including afterload so it led to desyncs (much like #8872).

Steps to reproduce

  1. Start a server with gamescript
  2. Connect a client to the same company
  3. Build a monorail station on the server


Changes EnableEngineForCompany to use GetCompanyRailtypes/GetCompanyRoadTypes like everything else.

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

@LordAro LordAro added the backport requested This PR should be backport to current release (RC / stable) label Apr 11, 2021
Copy link

LordAro commented Apr 12, 2021

Hmm. For backportability it should retain existing behaviour - anything else (i.e. fixing #9023) is a change
Shouldn't be too difficult to also make this command unlock the relevant railtype as well?

Copy link

PeterN commented Apr 12, 2021

I think this change is correct. Unlocking wagons should NOT enable the railtype. Having engines available is and should be the requirement.

Combined with #9023 it should be possible to have both worlds, just explicitly.

Copy link
Contributor Author

ldpl commented Apr 12, 2021

Yeah, this has nothing to do with #9023, I've no idea why it was even mentioned there.

@michicc michicc merged commit 7c7c6cd into OpenTTD:master Apr 17, 2021
@LordAro LordAro added backported This PR is backported to a current release (RC / stable) and removed backport requested This PR should be backport to current release (RC / stable) labels Apr 18, 2021
@ldpl ldpl deleted the engine-enable-railtypes branch September 19, 2021 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
backported This PR is backported to a current release (RC / stable)
None yet

Successfully merging this pull request may close these issues.

None yet

4 participants