Oops. Yep. That’s a bug.
A fix for this will be included in the next update. In the meantime you can patch your version by replacing the CalculateConnectionsForCellAndNeighbours with this:
/** Calculates the grid connections for a cell as well as its neighbours.
* This is a useful utility function if you want to modify the walkability of a single node in the graph.
*
* \snippet MiscSnippets.cs GridGraph.CalculateConnectionsForCellAndNeighbours
*/
public void CalculateConnectionsForCellAndNeighbours (int x, int z) {
CalculateConnections(x, z);
for (int i = 0; i < 8; i++) {
int nx = x + neighbourXOffsets[i];
int nz = z + neighbourZOffsets[i];
// Check if the new position is inside the grid
// Bitwise AND (&) is measurably faster than &&
// (not much, but this code is hot)
if (nx >= 0 & nz >= 0 & nx < width & nz < depth) {
CalculateConnections(nx, nz);
}
}
}