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

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

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

SamuXarick opened this issue Jan 13, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@SamuXarick
Copy link
Contributor

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

Does the same apply for ships and/or aircraft?

@TrueBrain
Copy link
Member

Does the same apply for ships and/or aircraft?

What did trains ever do to you?! :D

@glx22
Copy link
Contributor

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;

@TrueBrain TrueBrain added the bug Something isn't working label Feb 28, 2021
TrueBrain pushed a commit to TrueBrain/OpenTTD that referenced this issue Mar 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants