Probable infinite loop with FloodPath

I created a FloodPath tracer that runs during the map generation

My grid graph is 1024x1024 with 1-unit cells, which means we exceed a million nodes.
At the moment of the flood path tracer, Unity generates the error “Probable infinite loop.” Over 1,000,000 nodes searched.

This is completely logical, but shouldn’t we check if searchedNodes exceeds the total number of nodes instead?
I increased the value to 10 million, which resolves the error.

That’s one huge graph :smiley: .

But yeah, feel free to change that locally in your code. In almost every case, 1000000 searched nodes is WAY higher than one ever needs.