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]: Vehicle::motion_counter for articulated train engine parts no longer updated due to #12229 #12497

Closed
JGRennison opened this issue Apr 14, 2024 · 0 comments · Fixed by #12561
Labels
component: NewGRF This issue is related to NewGRFs

Comments

@JGRennison
Copy link
Contributor

Version of OpenTTD

Since #12229

Expected result

All parts of an articulated train engine should have their motion_counter updated.

Actual result

Only the head part now has its motion_counter updated.
This breaks running animations for NewGRFs such as Timberwolf's Trains.

Steps to reproduce

See Vehicle::motion_counter for an articulated engine

PeterN added a commit to PeterN/OpenTTD that referenced this issue Apr 14, 2024
…d correctly.

OpenTTD#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.

Make var 46 return motion_counter of the first engine, regardless of self or parent scope. This means var 46 is always in sync with the head engine, and avoids further changes to when motion_counter is updated.
PeterN added a commit to PeterN/OpenTTD that referenced this issue Apr 23, 2024
…arts.

NewGRFs relied on the incorrectly motion counter that was 'fixed' in OpenTTD#12229, so always update v->motion_counter for all vehicle parts.
@2TallTyler 2TallTyler added the component: NewGRF This issue is related to NewGRFs label May 7, 2024
PeterN added a commit that referenced this issue May 17, 2024
…12561)

NewGRFs relied on the incorrectly motion counter that was 'fixed' in #12229, so always update v->motion_counter for all vehicle parts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: NewGRF This issue is related to NewGRFs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants