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