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 #12497: [NewGRF] Increase vehicle motion counter for all parts. #12561

Merged
merged 1 commit into from May 17, 2024

Conversation

PeterN
Copy link
Member

@PeterN PeterN commented Apr 23, 2024

Motivation / Problem

#12229 stopped updating motion_counter for non-engine parts of trains, and in doing so accidentally followed the spec for NewGRF var 46, which breaks NewGRFs that used to accidentally work, but by the spec should not.

Fixes #12497.

Description

Some NewGRFs relied on the incorrectly motion counter that was 'fixed' in #12229, so always update v->motion_counter for all vehicle parts.

Always updating means that motion counters are still per-vehicle.

Limitations

Update motion counter for all vehicles might have a minor performance impact.

This still goes "against" the spec, but the spec could be updated to define this behaviour.

Alternatively we could leave #12497 option and let authors fix their sets.

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')

…arts.

NewGRFs relied on the incorrectly motion counter that was 'fixed' in OpenTTD#12229, so always update v->motion_counter for all vehicle parts.
@PeterN PeterN merged commit 8d26d03 into OpenTTD:master May 17, 2024
14 checks passed
@PeterN PeterN deleted the fix-12498-always-update branch May 17, 2024 19:50
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.

[Bug]: Vehicle::motion_counter for articulated train engine parts no longer updated due to #12229
2 participants