summaryrefslogtreecommitdiff
path: root/tools/editor
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2015-12-13 10:10:49 +0100
committerRémi Verschelde <remi@verschelde.fr>2015-12-13 10:10:49 +0100
commitcdf07327bc1e0c1acded9327e2447d258d8ad2fd (patch)
treea4b5d219c194912e993bb6d90e2f0f2f06227ce4 /tools/editor
parent4018ea63c76467a60aec308b610d2b9129fe449a (diff)
parent3dead22454f40cbf34ae7015143936acb359580b (diff)
Merge pull request #3045 from TheHX/pr-nav-mesh
Fix crash caused by a empty NavigationMesh
Diffstat (limited to 'tools/editor')
-rw-r--r--tools/editor/spatial_editor_gizmos.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/editor/spatial_editor_gizmos.cpp b/tools/editor/spatial_editor_gizmos.cpp
index 5efca44c7d..04a6b1b437 100644
--- a/tools/editor/spatial_editor_gizmos.cpp
+++ b/tools/editor/spatial_editor_gizmos.cpp
@@ -2283,6 +2283,8 @@ void NavigationMeshSpatialGizmo::redraw() {
}
}
+ if (faces.empty())
+ return;
Map<_EdgeKey,bool> edge_map;
DVector<Vector3> tmeshfaces;
@@ -2330,7 +2332,7 @@ void NavigationMeshSpatialGizmo::redraw() {
}
}
- Ref<TriangleMesh> tmesh = memnew( TriangleMesh);
+ Ref<TriangleMesh> tmesh = memnew( TriangleMesh );
tmesh->create(tmeshfaces);
if (lines.size())