diff --git a/modules/navigation/godot_navigation_server.cpp b/modules/navigation/godot_navigation_server.cpp index b73c5ca3e200..8950d913206b 100644 --- a/modules/navigation/godot_navigation_server.cpp +++ b/modules/navigation/godot_navigation_server.cpp @@ -788,8 +788,8 @@ COMMAND_2(agent_set_avoidance_priority, RID, p_agent, real_t, p_priority) { } RID GodotNavigationServer::obstacle_create() { - GodotNavigationServer *mut_this = const_cast(this); - MutexLock lock(mut_this->operations_mutex); + MutexLock lock(operations_mutex); + RID rid = obstacle_owner.make_rid(); NavObstacle *obstacle = obstacle_owner.get_or_null(rid); obstacle->set_self(rid);