Explorar el Código

Fix debug navmesh errors

Pawel Lampe hace 3 años
padre
commit
e17e4b34a8
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      scene/resources/navigation_mesh.cpp

+ 4 - 0
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;