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

NPF: Ship: Assertion failure when ship encounters shore #7226

Closed
JGRennison opened this issue Feb 14, 2019 · 2 comments
Closed

NPF: Ship: Assertion failure when ship encounters shore #7226

JGRennison opened this issue Feb 14, 2019 · 2 comments
Labels
bug Something isn't working regression It used to work, and now it's broken.
Milestone

Comments

@JGRennison
Copy link
Contributor

Version of OpenTTD

Trunk (since commit d814dd3)

Expected result

No assert failures occur

Actual result

Assertion: Error: Assertion failed at line 1166 of /home/jgr/openttd/trunk/src/pathfinder/npf/npf.cpp: ftd.best_trackdir != INVALID_TRACKDIR can be triggered by obstacles in the path of ships when using NPF pathfinder.
This assertion was added in d814dd3 (PR #7114)

Steps to reproduce

See attached savegame. The issue seems to occur when the ship is travelling in a diagonal (with reference to the tile axes) direction and encounters a perpendicular shore slope.
JGR Testing & Maintenance Ltd, 1945-09-12.sav.zip

@PeterN PeterN added bug Something isn't working regression It used to work, and now it's broken. labels Feb 14, 2019
@PeterN PeterN added this to the 1.9.0 milestone Feb 14, 2019
@PeterN
Copy link
Member

PeterN commented Feb 14, 2019

Should be pretty simple to revert just that single hunk from d814dd3. I can prepare this later.

@J0anJosep
Copy link
Contributor

I will look into it. NPF shouldn't be executed on that case. It seems a 90º turn problem. I will look into it this weekend. Reverting the previous changes is doable, but it would be better to modify the ShipController code and keep the asserts on NPF.

J0anJosep added a commit to J0anJosep/OpenTTD that referenced this issue Feb 14, 2019
J0anJosep added a commit to J0anJosep/OpenTTD that referenced this issue Feb 18, 2019
J0anJosep added a commit to J0anJosep/OpenTTD that referenced this issue Feb 18, 2019
J0anJosep added a commit to J0anJosep/OpenTTD that referenced this issue Feb 18, 2019
nielsmh pushed a commit to nielsmh/OpenTTD that referenced this issue Mar 11, 2019
douiwby pushed a commit to douiwby/OpenTTD that referenced this issue Apr 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working regression It used to work, and now it's broken.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants