You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
Fix MultiMeshInstance crash in navmesh baking when MultiMesh Resource is empty
Fix MultiMeshInstance crash in navmesh baking when MultiMesh Resource is empty
This commit is contained in:
@@ -172,6 +172,7 @@ void NavigationMeshGenerator::_parse_geometry(const Transform3D &p_navmesh_trans
|
|||||||
if (Object::cast_to<MultiMeshInstance3D>(p_node) && p_generate_from != NavigationMesh::PARSED_GEOMETRY_STATIC_COLLIDERS) {
|
if (Object::cast_to<MultiMeshInstance3D>(p_node) && p_generate_from != NavigationMesh::PARSED_GEOMETRY_STATIC_COLLIDERS) {
|
||||||
MultiMeshInstance3D *multimesh_instance = Object::cast_to<MultiMeshInstance3D>(p_node);
|
MultiMeshInstance3D *multimesh_instance = Object::cast_to<MultiMeshInstance3D>(p_node);
|
||||||
Ref<MultiMesh> multimesh = multimesh_instance->get_multimesh();
|
Ref<MultiMesh> multimesh = multimesh_instance->get_multimesh();
|
||||||
|
if (multimesh.is_valid()) {
|
||||||
Ref<Mesh> mesh = multimesh->get_mesh();
|
Ref<Mesh> mesh = multimesh->get_mesh();
|
||||||
if (mesh.is_valid()) {
|
if (mesh.is_valid()) {
|
||||||
int n = multimesh->get_visible_instance_count();
|
int n = multimesh->get_visible_instance_count();
|
||||||
@@ -183,6 +184,7 @@ void NavigationMeshGenerator::_parse_geometry(const Transform3D &p_navmesh_trans
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef MODULE_CSG_ENABLED
|
#ifdef MODULE_CSG_ENABLED
|
||||||
if (Object::cast_to<CSGShape3D>(p_node) && p_generate_from != NavigationMesh::PARSED_GEOMETRY_STATIC_COLLIDERS) {
|
if (Object::cast_to<CSGShape3D>(p_node) && p_generate_from != NavigationMesh::PARSED_GEOMETRY_STATIC_COLLIDERS) {
|
||||||
|
|||||||
Reference in New Issue
Block a user