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

addWall() fails at the edge of the map #4

Closed
sbj42 opened this issue Jul 24, 2018 · 0 comments
Closed

addWall() fails at the edge of the map #4

sbj42 opened this issue Jul 24, 2018 · 0 comments

Comments

@sbj42
Copy link
Owner

sbj42 commented Jul 24, 2018

Adding a wall at the very edge of the map fails. For instance:

const fovMap = new FieldOfViewMap(2, 2);
fovMap.addWall(0, 0, geom.Direction.NORTH);
fovMap.getWall(0, 0, geom.Direction.NORTH); // <-- returns false

addWall() is avoiding putting an opposing wall out of bounds, but in doing so it fails to put the requested in-bounds wall.

Walls on the edge of the map aren't of much use to the field-of-view algorithm, but in case someone relies on FieldOfViewMap to save wall positions, it should still remember them.

@sbj42 sbj42 closed this as completed in 8e1451e Jul 24, 2018
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