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

AIRoad.CanBuildConnectedRoadPartsHere [issue from DevZone] #2

Open
Leffe108 opened this issue Apr 2, 2020 · 0 comments
Open

AIRoad.CanBuildConnectedRoadPartsHere [issue from DevZone] #2

Leffe108 opened this issue Apr 2, 2020 · 0 comments

Comments

@Leffe108
Copy link
Contributor

Leffe108 commented Apr 2, 2020

<Samu> https://dev.openttdcoop.org/projects/lib-pathfinderroad/repository/entry/main.nut#L257
<Samu> AIRoad.CanBuildConnectedRoadPartsHere can return -1
<Samu> line needs to be changed to AIRoad.CanBuildConnectedRoadPartsHere(cur_node, path.GetParent().GetTile(), next_tile) > 1
<Samu> can you change it? it says you're project manager
<Samu> i mean > 0
<Samu> then i guess superlib would also needs fixed
...
<Samu> CanBuildConnectedRoadParts can in fact return -1, 0, 1 and 2
...
<Samu> there has been a recent fix regarding that function on OpenTTD side, so it's kind of relevant if it was also fixed in the library
<Samu> it still works, doesn't appear to be breaking AIs, but, it's accepting -1 as true
...
<Samu> btw, you may add this link https://github.com/OpenTTD/OpenTTD/pull/8036
<Samu> makes it easier to understand what's solved

Source

Original issue by zuu

Leffe108 added a commit that referenced this issue Apr 2, 2020
AIRoad.CanBuildConnectedRoadPartsHere can return
-1 on incorrect params or if you play games of
different map sizes without restarting OpenTTD
inbetween before OpenTTD 1.10.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant