Merge pull request #3045 from TheHX/pr-nav-mesh
Fix crash caused by a empty NavigationMesh
This commit is contained in:
commit
cdf07327bc
|
@ -2283,6 +2283,8 @@ void NavigationMeshSpatialGizmo::redraw() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (faces.empty())
|
||||||
|
return;
|
||||||
|
|
||||||
Map<_EdgeKey,bool> edge_map;
|
Map<_EdgeKey,bool> edge_map;
|
||||||
DVector<Vector3> tmeshfaces;
|
DVector<Vector3> tmeshfaces;
|
||||||
|
@ -2330,7 +2332,7 @@ void NavigationMeshSpatialGizmo::redraw() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref<TriangleMesh> tmesh = memnew( TriangleMesh);
|
Ref<TriangleMesh> tmesh = memnew( TriangleMesh );
|
||||||
tmesh->create(tmeshfaces);
|
tmesh->create(tmeshfaces);
|
||||||
|
|
||||||
if (lines.size())
|
if (lines.size())
|
||||||
|
|
Loading…
Reference in New Issue