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

setting speed limit also set timetable (but should not) #6313

Closed
DorpsGek opened this issue Jun 6, 2015 · 5 comments
Closed

setting speed limit also set timetable (but should not) #6313

DorpsGek opened this issue Jun 6, 2015 · 5 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

DorpsGek commented Jun 6, 2015

romazoon opened the ticket and wrote:

pretty much what the title say.

if you set a speed limit, the "pre-filled" travel time is set in stone (problem is that setting a speed limit doesn t mean player want a fix time of travel)

to reproduce, make a train go from A to B, let it run, then once "pre-filling" is done (Not Auto-fill) simply add a speed limit.

Reported version: 1.5.1
Operating system: All


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

marcole wrote:

Yes, this looks as a bug to me too.
Actually, setting the wait time sets the pre-filled travel time to the timetable and vice versa.
And setting max speed sets both pre-filled wait and travel times to the timetable.
It is due to (imho incorrect) multiple call to ChangeTimetable function when pre-filled times are available.
It was probably introduced with pre-filled and not activated times in timetables.

Appended is the suggested patch for trunk 27298 that calls the function only for the parameter being set.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/6313#comment13969

@DorpsGek
Copy link
Member Author

marcole wrote:

I have also noticed a different issue when manually setting the wait time at the station.
If the time is set while vehicle is already loading and upon its arrival was not yet set, it will get reset and not active when the vehicle leaves.
I don't think this is the wanted behaviour and was probably also introduced with pre-filled times in timetables.

The issue is little more complicated as I don't see that much into the code yet.
It seems to me that the problem is in UpdateVehicleTimetable function that checks the information in vehicle's current order.
The wait time on the other hand alters only the real order because then the Order::Equals check no longer returns true.

I'm not sure what is the best solution but my suggestion (although a bit ugly yet) is in the appended patch.
The patch is the update of the previous one.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/6313#comment13970

@DorpsGek
Copy link
Member Author

frosch wrote:

I've committed your first patch, and fixed the second issue.
I am sorry, I forgot to attribute the first patch to you in the commit message, so instead I attributed the second fix to make up for it :)


This comment was imported from FlySpray: https://bugs.openttd.org/task/6313#comment13979

@DorpsGek
Copy link
Member Author

frosch closed the ticket.

Reason for closing: Fixed

in r27301 and 27302


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

@DorpsGek
Copy link
Member Author

marcole wrote:

No problem, glad I could be of any help, thanks :-)


This comment was imported from FlySpray: https://bugs.openttd.org/task/6313#comment13984

@DorpsGek DorpsGek added flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) Vehicles 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