diff options
author | Pawel Lampe <pawel.lampe@gmail.com> | 2022-04-04 23:03:14 +0200 |
---|---|---|
committer | Pawel Lampe <pawel.lampe@gmail.com> | 2022-04-04 23:03:14 +0200 |
commit | e17e4b34a81a1b4490ae0aa9f0752951d027e75c (patch) | |
tree | b024163ca7e01d3a2159e782ea4b0e84b71aba06 | |
parent | 1abb5ebf6532944a9fd0d1acf9ad61a0df1bb0ed (diff) |
Fix debug navmesh errors
-rw-r--r-- | scene/resources/navigation_mesh.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/scene/resources/navigation_mesh.cpp b/scene/resources/navigation_mesh.cpp index 47a87bdea5..552fa84bad 100644 --- a/scene/resources/navigation_mesh.cpp +++ b/scene/resources/navigation_mesh.cpp @@ -388,6 +388,10 @@ Ref<Mesh> NavigationMesh::get_debug_mesh() { debug_mesh = Ref<ArrayMesh>(memnew(ArrayMesh)); + if (!lines.size()) { + return debug_mesh; + } + Array arr; arr.resize(Mesh::ARRAY_MAX); arr[Mesh::ARRAY_VERTEX] = varr; |