Fix NavigationMeshSourceGeometryData merge crash
Fixes crash when trying to merge with a null source geometry.
This commit is contained in:
parent
83b916bb00
commit
497afeaf05
|
@ -120,6 +120,8 @@ void NavigationMeshSourceGeometryData2D::add_obstruction_outline(const PackedVec
|
|||
}
|
||||
|
||||
void NavigationMeshSourceGeometryData2D::merge(const Ref<NavigationMeshSourceGeometryData2D> &p_other_geometry) {
|
||||
ERR_FAIL_NULL(p_other_geometry);
|
||||
|
||||
// No need to worry about `root_node_transform` here as the data is already xformed.
|
||||
traversable_outlines.append_array(p_other_geometry->traversable_outlines);
|
||||
obstruction_outlines.append_array(p_other_geometry->obstruction_outlines);
|
||||
|
|
|
@ -172,6 +172,8 @@ void NavigationMeshSourceGeometryData3D::add_faces(const PackedVector3Array &p_f
|
|||
}
|
||||
|
||||
void NavigationMeshSourceGeometryData3D::merge(const Ref<NavigationMeshSourceGeometryData3D> &p_other_geometry) {
|
||||
ERR_FAIL_NULL(p_other_geometry);
|
||||
|
||||
// No need to worry about `root_node_transform` here as the vertices are already xformed.
|
||||
const int64_t number_of_vertices_before_merge = vertices.size();
|
||||
const int64_t number_of_indices_before_merge = indices.size();
|
||||
|
|
Loading…
Reference in New Issue