Skip to content

allows passing through up-down/left-right borders on option #24

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

Merged
merged 3 commits into from
Dec 19, 2019

Conversation

HSTEHSTEHSTE
Copy link
Contributor

Implementation for the minor improvement suggested in issue #23.

@@ -95,7 +101,7 @@ def neighbors(self, node, diagonal_movement=DiagonalMovement.never):
neighbors.append(self.nodes[y - 1][x])
s0 = True
# →
if x == self.width and self.passable_left_right_border:
if x == self.width - 1 and self.passable_left_right_border:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch with the -1 (self.width is the length and we are accessing array indices, so this might raise an IndexError)! I think this bug was not seen before? Good bugfix.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think I made the bug myself and then fixed it :D Thanks anyway!

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh oups... Anyway, thanks for the pull request!

@brean brean merged commit a61b67f into brean:master Dec 19, 2019
@brean brean mentioned this pull request Dec 19, 2019
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.

2 participants