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

Protect can_step_taken_wrt_to_zoc against null terrain #1317

Merged
merged 1 commit into from
Aug 26, 2022

Conversation

lmoureaux
Copy link
Contributor

Using can_step_taken_wrt_to_zoc in the path finding code (through
unit_can_move_to_tile) makes it possible that unseen tiles are passed to it. We
should therefore not assume that the terrain of the tile is known.

Given our inability to reproduce #1315, this may not be a complete fix. It does protect the code path shown in the stack trace there. I looked around a bit and couldn't find any other unchecked use of tile->terrain in the path finding code.

Closes #1315.

Using can_step_taken_wrt_to_zoc in the path finding code (through
unit_can_move_to_tile) makes it possible that unseen tiles are passed to it. We
should therefore not assume that the terrain of the tile is known.

Closes longturn#1315.
@psampathkumar psampathkumar merged commit 0707811 into longturn:master Aug 26, 2022
@psampathkumar psampathkumar deleted the bugfix/path-finding-crash branch August 26, 2022 11:31
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

Successfully merging this pull request may close these issues.

Crash in while pathfinding in goto
2 participants