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
Milestone

Comments

@JGRennison
Copy link
Contributor

@JGRennison JGRennison commented Feb 14, 2019

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 this to the 1.9.0 milestone Feb 14, 2019
@PeterN
Copy link
Member

@PeterN 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

@J0anJosep J0anJosep commented Feb 14, 2019

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
@michicc michicc closed this in 6ca637b 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
J0anJosep added a commit to J0anJosep/OpenTTD that referenced this issue Feb 18, 2019
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Mar 11, 2019
douiwby added 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.