Fix crash during navmesh build when actor gets removed
This commit is contained in:
@@ -628,7 +628,7 @@ class NavMeshTileBuildTask : public ThreadPoolTask
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
Scene* Scene;
|
Scene* Scene;
|
||||||
NavMesh* NavMesh;
|
ScriptingObjectReference<NavMesh> NavMesh;
|
||||||
NavMeshRuntime* Runtime;
|
NavMeshRuntime* Runtime;
|
||||||
BoundingBox TileBoundsNavMesh;
|
BoundingBox TileBoundsNavMesh;
|
||||||
Matrix WorldToNavMesh;
|
Matrix WorldToNavMesh;
|
||||||
@@ -644,6 +644,11 @@ public:
|
|||||||
{
|
{
|
||||||
PROFILE_CPU_NAMED("BuildNavMeshTile");
|
PROFILE_CPU_NAMED("BuildNavMeshTile");
|
||||||
|
|
||||||
|
const auto navMesh = NavMesh.Get();
|
||||||
|
if (!navMesh)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (GenerateTile(NavMesh, Runtime, X, Y, TileBoundsNavMesh, WorldToNavMesh, TileSize, Config))
|
if (GenerateTile(NavMesh, Runtime, X, Y, TileBoundsNavMesh, WorldToNavMesh, TileSize, Config))
|
||||||
{
|
{
|
||||||
LOG(Warning, "Failed to generate navmesh tile at {0}x{1}.", X, Y);
|
LOG(Warning, "Failed to generate navmesh tile at {0}x{1}.", X, Y);
|
||||||
|
|||||||
Reference in New Issue
Block a user