1
0
Fork 0

Merge pull request #74895 from smix8/gridmap_navrid_error_spam_3.x

[3.5+] Fix GridMap free navigation RID error spam
This commit is contained in:
lawnjelly 2023-03-21 14:28:25 +00:00 committed by GitHub
commit b0c399ec8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -473,7 +473,10 @@ bool GridMap::_octant_update(const OctantKey &p_key) {
//erase navigation
for (Map<IndexKey, Octant::NavMesh>::Element *E = g.navmesh_ids.front(); E; E = E->next()) {
NavigationServer::get_singleton()->free(E->get().region);
if (E->get().region.is_valid()) {
NavigationServer::get_singleton()->free(E->get().region);
E->get().region = RID();
}
if (E->get().navmesh_debug_instance.is_valid()) {
VS::get_singleton()->free(E->get().navmesh_debug_instance);
}