4.1.1 NodeLink2 & AIBase.target

AIBase.target no longer handles being sent a null target. Seems like it will be depreciated, but was the first bug I ran into updating to 4.1.

I get an error when scanning with NodeLink2 (I have 2 LayeredGridGraphs):
NullReferenceException: Object reference not set to an instance of an object
PointGenerator.cs:191

That specific part has a bug:

if (nodes == null || nodeCount == nodes.Length) { var newNodes = new PointNode[nodes != null ? System.Math.Max(nodes.Length+4, nodes.Length*2) : 4]; nodes.CopyTo(newNodes, 0); // <-- nodes can be null here nodes = newNodes; }

Instead of that CopyTo, the old way seems to work when I put it in:

for( int i = 0; i < nodeCount; i++ ) newNodes[i] = nodes[i];

I am using Unity 2017.1.0p2, A* Pathfinding 4.1.1, Experimental .Net 4.6

Hi

Yep. Both of those were a dumb mistakes by me. I also found those bugs a week or two ago, but the beta hasn’t been updated since then. They will be fixed in the next beta.

1 Like