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

(Old) pathfinder does not check railtypes #161

Closed
DorpsGek opened this issue May 10, 2006 · 2 comments
Closed

(Old) pathfinder does not check railtypes #161

DorpsGek opened this issue May 10, 2006 · 2 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

Rubidium opened the ticket and wrote:

The old pathfinder (pathfind.c/NTP), in NTPEnum (in 0.4.7), does not check for railtypes. This results in a train favouring the shortest path of rails even if the path contains incompatible railtypes (see the attachment for an example). The train will, sometimes, take the correct route, but with the new pathfinder (NPF) routes it always over the correct route.

There are, as far as I found, three distinct places where the checks need to be added (line numbers indicate start of block in 0.4.7):

The first case (line 718), where the tile is a tunnel tile, exists in both 0.4.7 and the current trunk version.

The second case (line 750), where the tile is not a 'normal (or signalled) rail tile', so a bridge, depot, waypoint or level crossing, exists in both 0.4.7 and the current trunk version. Fixing this can be difficult as you need to get the direction of the train for the bridge to get the correct railtype.

The third case (line 770), where the tile is a normal (or signalled) rail tile is fixed in trunk by rev 4008+4110 (elrails), but it is not backported to 0.4.7. This can therefore easily be fixed by backporting the fix.

Reported version: 0.4.7
Operating system: All


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

Rubidium wrote:

Savegame that shows all the failing scenarios. The trains will not always take the wrong route, but it takes the wrong route sometimes after a few tries, while NPF never takes the wrong route after a few tries.


This comment was imported from FlySpray: https://bugs.openttd.org/task/161#comment269

@DorpsGek
Copy link
Member Author

Celestar closed the ticket.

Reason for closing: Fixed


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

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