From 697d4a32fc184cfbeae9abe0855e6f26da3ddf90 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sat, 2 Sep 2023 13:38:20 +0200 Subject: [PATCH] Backported from godot4: Change 2D navigation ProjectSettings from integers to floats Changes 2D navigation ProjectSettings from integers to floats. - smix8 https://github.com/godotengine/godot/commit/2852fb43f707789bc05083302b1f2d6a19edec42 --- doc/classes/ProjectSettings.xml | 2 +- scene/resources/world_2d.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 28da1ef69..fa3f2d983 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -1514,7 +1514,7 @@ Default edge connection margin for 2D navigation maps. See [method Navigation2DServer.map_set_edge_connection_margin]. - + Default link connection radius for 2D navigation maps. See [method NavigationServer2D.map_set_link_connection_radius]. diff --git a/scene/resources/world_2d.cpp b/scene/resources/world_2d.cpp index 8a94bbce4..0e3c14623 100644 --- a/scene/resources/world_2d.cpp +++ b/scene/resources/world_2d.cpp @@ -384,7 +384,7 @@ World2D::World2D() { Navigation2DServer::get_singleton()->map_set_cell_size(navigation_map, GLOBAL_DEF("navigation/2d/default_cell_size", 1.0)); Navigation2DServer::get_singleton()->map_set_cell_height(navigation_map, GLOBAL_DEF("navigation/2d/default_cell_height", 1.0)); Navigation2DServer::get_singleton()->map_set_edge_connection_margin(navigation_map, GLOBAL_DEF("navigation/2d/default_edge_connection_margin", 1.0)); - Navigation2DServer::get_singleton()->map_set_link_connection_radius(navigation_map, GLOBAL_DEF("navigation/2d/default_link_connection_radius", 4)); + Navigation2DServer::get_singleton()->map_set_link_connection_radius(navigation_map, GLOBAL_DEF("navigation/2d/default_link_connection_radius", 4.0)); Navigation2DServer::get_singleton()->map_set_use_edge_connections(navigation_map, GLOBAL_DEF("navigation/2d/use_edge_connections", true)); indexer = memnew(SpatialIndexer2D);