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

LeaveStation in CheckIfRoadVehNeedsService is useless #4295

Closed
DorpsGek opened this issue Dec 11, 2010 · 1 comment
Closed

LeaveStation in CheckIfRoadVehNeedsService is useless #4295

DorpsGek opened this issue Dec 11, 2010 · 1 comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

fonsinchen opened the ticket and wrote:

Line 1571 in roadveh_cmd.cpp states:

if (v->current_order.IsType(OT_LOADING)) v->LeaveStation();

However, in line 1537 we return from that function if

!v->NeedsAutomaticServicing()

NeedsAutomaticServicing always returns false if v->current_order.IsType(OT_LOADING). Any change to v->current_order between line 1537 and 1571 is coupled with returning from the function so the condition in line 1571 is never true. This is fairly confusing if you're searching for places where LeaveStation can be called.

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/4295
@DorpsGek
Copy link
Member Author

Rubidium closed the ticket.

Reason for closing: Fixed

In r21465


This comment was imported from FlySpray: https://bugs.openttd.org/task/4295

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant