mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-12-23 12:26:59 +01:00
Fix MultiMeshInstance crash in navmesh baking when MultiMesh Resource is empty
Fix MultiMeshInstance crash in navmesh baking when MultiMesh Resource is empty (cherry picked from commit caceceab0819dca9da4ca3c268bc07ded933e332)
This commit is contained in:
parent
690b82ff41
commit
62e781b914
@ -170,6 +170,7 @@ void NavigationMeshGenerator::_parse_geometry(const Transform &p_navmesh_xform,
|
||||
if (Object::cast_to<MultiMeshInstance>(p_node) && p_generate_from != NavigationMesh::PARSED_GEOMETRY_STATIC_COLLIDERS) {
|
||||
MultiMeshInstance *multimesh_instance = Object::cast_to<MultiMeshInstance>(p_node);
|
||||
Ref<MultiMesh> multimesh = multimesh_instance->get_multimesh();
|
||||
if (multimesh.is_valid()) {
|
||||
Ref<Mesh> mesh = multimesh->get_mesh();
|
||||
if (mesh.is_valid()) {
|
||||
int n = multimesh->get_visible_instance_count();
|
||||
@ -181,6 +182,7 @@ void NavigationMeshGenerator::_parse_geometry(const Transform &p_navmesh_xform,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (Object::cast_to<StaticBody>(p_node) && p_generate_from != NavigationMesh::PARSED_GEOMETRY_MESH_INSTANCES) {
|
||||
StaticBody *static_body = Object::cast_to<StaticBody>(p_node);
|
||||
|
Loading…
Reference in New Issue
Block a user