Skip to content

Commit f54379b

Browse files
committed
3d grid has 26 neighbors
1 parent 7103bb0 commit f54379b

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ int heuristic(void *ud, unsigned int pos, struct pathfinding_neighbor result[]);
4646
The coord should be encoded into a unsigned int, the typical way is `(x << 16) | y`.
4747

4848
The heuristic function should returns a pathfinding_neighbor array, which describes the set of positions connected to the location.
49-
The maximum number of the result[] is 16, usually 8 is enough.
49+
The maximum number of the result[] is 32, usually 8 is enough.
5050

5151
* `.pos` : The position of the connection.
5252
* `.dist` : The distance to the location.

pathfinding.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2525
#include <string.h>
2626
#include <assert.h>
2727

28-
#define NEIGHBOR_MAX 16
28+
// 3D grid has 26 neighbors
29+
#define NEIGHBOR_MAX 32
2930

3031
typedef unsigned int uint;
3132

0 commit comments

Comments
 (0)