Fix threaded bake logic in NavigationPolygonInstance and NavigationMeshInstance.

This commit is contained in:
Relintai 2023-08-30 14:36:21 +02:00
parent 62e2b1623a
commit 2c3c7dcc73
2 changed files with 2 additions and 2 deletions

View File

@ -320,7 +320,7 @@ void NavigationPolygonInstance::bake_navigation_polygon(bool p_on_thread) {
baking_started = true;
navpoly->clear();
if (p_on_thread) { // && OS::get_singleton()->get_render_thread_mode() == OS::RenderThreadMode::RENDER_SEPARATE_THREAD
if (p_on_thread && OS::get_singleton()->can_use_threads()) {
Ref<FuncRef> f;
f.instance();
f->set_instance(this);

View File

@ -291,7 +291,7 @@ void NavigationMeshInstance::bake_navigation_mesh(bool p_on_thread) {
navmesh->clear();
if (p_on_thread && OS::get_singleton()->get_render_thread_mode() == OS::RenderThreadMode::RENDER_SEPARATE_THREAD) {
if (p_on_thread && OS::get_singleton()->can_use_threads()) {
Ref<FuncRef> f;
f.instance();
f->set_instance(this);