瀏覽代碼

Merge pull request #78596 from smix8/navmes_old_poly_clear_4.x

Fix NavigationMesh not clearing old polygons
Rémi Verschelde 2 年之前
父節點
當前提交
fee49f4f9d
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      modules/navigation/navigation_mesh_generator.cpp

+ 1 - 0
modules/navigation/navigation_mesh_generator.cpp

@@ -738,6 +738,7 @@ void NavigationMeshGenerator::bake_from_source_geometry_data(Ref<NavigationMesh>
 		nav_vertices.push_back(Vector3(v[0], v[1], v[2]));
 	}
 	p_navigation_mesh->set_vertices(nav_vertices);
+	p_navigation_mesh->clear_polygons();
 
 	for (int i = 0; i < detail_mesh->nmeshes; i++) {
 		const unsigned int *detail_mesh_m = &detail_mesh->meshes[i * 4];