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 51bd344f10: Incorrect translation table used for older NewGRFs. #13131

Merged
merged 1 commit into from
Nov 29, 2024

Conversation

PeterN
Copy link
Member

@PeterN PeterN commented Nov 28, 2024

Motivation / Problem

Incorrect logic was used to select the default translation table for older GRFs in #12646.

A litany of incorrect logic.

  • Selection of climate-dependent translation table for pre-v7 GRFs was incorrectly applied to pre-v8.
  • Where the use of bitnum translation table was used for pre-v7 GRFs, it incorrectly used this instead of an installed translation table.
  • Forcefully installing a default translation table meant that it was not actually possible to know if the translation table was installed by the NewGRF or if it is default.

Description

No longer force-install a translation table. We don't revert back to the old ways of different logic to select cargo, we now just pick a prebuilt default translation table instead of installing it.

Pick the correct translation depending depending on context. In most cases this is:

  1. The installed table
  2. If pre-v7 then the climate-dependent table.
  3. Otherwise the climate-independent table.

In the one place where pre-v7 force uses the bitnums, then any installed table is ignored. This might not be correct, but it is the behaviour that was used prior to #12646.

Limitations

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 touches english.txt or translations? Check the guidelines
  • 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, game_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

Incorrect logic was used to select the default translation table for older GRFs.
@PeterN
Copy link
Member Author

PeterN commented Nov 28, 2024

Example of one wagon. Not exactly an exhaustive test, but one none the less.

14.1:
image
master:
image
This PR:
image

@PeterN PeterN merged commit b6aece5 into OpenTTD:master Nov 29, 2024
14 checks passed
@PeterN PeterN deleted the fix-12646 branch November 29, 2024 07:46
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 this pull request may close these issues.

2 participants