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

Stopped road vehicle displays a speed different than 0. #8565

Open
SamuXarick opened this issue Jan 13, 2021 · 3 comments
Open

Stopped road vehicle displays a speed different than 0. #8565

SamuXarick opened this issue Jan 13, 2021 · 3 comments

Comments

@SamuXarick
Copy link
Contributor

@SamuXarick SamuXarick commented Jan 13, 2021

Version of OpenTTD

ebaeceb

Expected result

Either display 0 km/h or omit the speed since it's currently stopped.

Actual result

Henfingburg Transport, 1952-07-26
Road vehicle 22 is stopped, but when I hover over the "current vehicle action" it says it's moving at 53 km/h.

Steps to reproduce

Stop a moving road vehicle.

@James103
Copy link
Contributor

@James103 James103 commented Jan 13, 2021

Does the same apply for ships and/or aircraft?

@TrueBrain
Copy link
Member

@TrueBrain TrueBrain commented Jan 13, 2021

Does the same apply for ships and/or aircraft?

What did trains ever do to you?! :D

@glx22
Copy link
Contributor

@glx22 glx22 commented Jan 13, 2021

Seems to be a cache update issue. On Start/Stop speed is set to 0

if (v->type != VEH_TRAIN) v->cur_speed = 0; // trains can stop 'slowly'

Then cache is supposed to be updated by
v->SetLastSpeed();

But it's prevented by
if (v->vehstatus & VS_STOPPED) return true;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.