Merge pull request #3045 from TheHX/pr-nav-mesh

Fix crash caused by a empty NavigationMesh
This commit is contained in:
Rémi Verschelde 2015-12-13 10:10:49 +01:00
commit cdf07327bc
1 changed files with 3 additions and 1 deletions

View File

@ -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())