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

Recursive Shadowcasting range #151

Open
mingos777 opened this issue Dec 16, 2018 · 1 comment
Open

Recursive Shadowcasting range #151

mingos777 opened this issue Dec 16, 2018 · 1 comment
Labels

Comments

@mingos777
Copy link
Contributor

While testing Recursive Shadowcasting, I ran into an issue with its range treatment. I pass in Infinity to the compute method, hoping it will just stop when the map transparency is false. It does not and instead, it enters an infinite loop:

_castVisibility(...args) {
		if (visSlopeStart < visSlopeEnd) { return; }
		for (let i = row; i <= radius; i++) {
...

The for loop above never terminates.

For the record, both Precise and Discrete accept Infinity and terminate properly whenever the map says it's not transparent anymore.

@ondras ondras added the bug label Dec 16, 2018
@ondras
Copy link
Owner

ondras commented Dec 16, 2018

Good find!

/cc @thesnarky1, because he is the author of the Recursive Shadowcasting impl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants