From 2d36b5f6391b3acbca5b6909283ae1cc3fccb87b Mon Sep 17 00:00:00 2001 From: ikpil Date: Sun, 31 Dec 2023 17:12:45 +0900 Subject: [PATCH] fixed null mesh data in tiles. --- src/DotRecast.Detour/DtNavMesh.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DotRecast.Detour/DtNavMesh.cs b/src/DotRecast.Detour/DtNavMesh.cs index 2f2e494..740f0a4 100644 --- a/src/DotRecast.Detour/DtNavMesh.cs +++ b/src/DotRecast.Detour/DtNavMesh.cs @@ -43,7 +43,7 @@ namespace DotRecast.Detour /** A version number used to detect compatibility of navigation tile states. */ public const int DT_NAVMESH_STATE_VERSION = 1; - + public const int DT_SALT_BITS = 16; public const int DT_TILE_BITS = 28; public const int DT_POLY_BITS = 20; @@ -284,7 +284,7 @@ namespace DotRecast.Detour return DtStatus.DT_FAILURE | DtStatus.DT_INVALID_PARAM; } - if (m_tiles[it].salt != salt || m_tiles[it].data.header == null) + if (m_tiles[it].salt != salt || m_tiles[it].data == null || m_tiles[it].data.header == null) { return DtStatus.DT_FAILURE | DtStatus.DT_INVALID_PARAM; }