Fix NavigationPolygon not updating consistently on rebakes

Fixes that NavigationPolygon did not update in all cases because the internal NavigationMesh was not always unref and freed which blocked creating a new mesh later if nothing else freed it.
This commit is contained in:
smix8 2024-07-14 21:53:14 +02:00
parent 97b8ad1af0
commit 9dd05964d5
1 changed files with 4 additions and 0 deletions

View File

@ -193,6 +193,10 @@ void NavigationPolygon::set_data(const Vector<Vector2> &p_vertices, const Vector
for (int i = 0; i < p_polygons.size(); i++) {
polygons.write[i].indices = p_polygons[i];
}
{
MutexLock lock(navigation_mesh_generation);
navigation_mesh.unref();
}
}
void NavigationPolygon::get_data(Vector<Vector2> &r_vertices, Vector<Vector<int>> &r_polygons) {