getPathLength

getPathLength(number cell1, number cell2, [array<integer> ignoredCells]) → integer length
Returns the length of a path between cell1 and cell2 that avoids occupied cells, except ignoredCells which are considered empty even when an entity is present. This function is equivalent to count(getPath(cell1, cell2, ignoredCells)).

The starting cell cell1 is never counted in the result. The destination cell cell2 is counted in the result if and only if it is empty or ignored by ignoredCells.

If no path exists between the two cells, getPathLength returns null.

Returns the length of the shortest path between two cells cell1 and cell2 that avoids obstacles, ignoring the cells contained in the array ignoredCells. This function is equivalent to count(getPath(cell1, cell2, ignoredCells)). If a player stands on an ignored cell, the path can go through them.

The starting cell cell1 is never counted in the result. The cell cell2 is counted in the result if and only if it is empty or ignored by ignoredCells.

If no path exists between the two cells, getPathLength returns null.

Parameters
Return