Bug - Graph count limit reached when graph count is at MaxCount -1

I’ve been encountering this issue for a while, and I found the reason for it.

In AstarData.cs , this is the code :

if (graphs != null && graphs.Length >= GraphNode.MaxGraphCount-1) { throw new System.Exception("Graph Count Limit Reached. You cannot have more than " + GraphNode.MaxGraphCount + " graphs. Some compiler directives can change this limit, e.g ASTAR_MORE_AREAS, look under the " + "'Optimizations' tab in the A* Inspector"); }

This is failing since if the length is 2 and the max graph count is 3 -> 2>=(3-1) -> true
It needs to be
if (graphs != null && graphs.Length > GraphNode.MaxGraphCount-1)

or
if (graphs != null && graphs.Length >= GraphNode.MaxGraphCount)

is there a reason you were limiting to MaxLimit-1 ?

That’s probably just a stupid typo on my side. I cannot think of a reason it should be limited to MaxGraphCount-1.
Thanks for noticing.