diff options
author | smix8 <52464204+smix8@users.noreply.github.com> | 2023-10-23 03:55:35 +0200 |
---|---|---|
committer | smix8 <52464204+smix8@users.noreply.github.com> | 2023-12-04 19:50:17 +0100 |
commit | 25bf20d7a5acf5f20bcf8c6979db0310222d8b5f (patch) | |
tree | 9a1a50763a3c6c35ef38b32b46a6b0d630deb04f /scene/2d/navigation_region_2d.cpp | |
parent | d76c1d0e516fedc535a2e394ab780cac79203477 (diff) | |
download | redot-engine-25bf20d7a5acf5f20bcf8c6979db0310222d8b5f.tar.gz |
Fix missing NavigationRegion property updates in constructor
Fixes missing NavigationRegion property updates in constructor.
Diffstat (limited to 'scene/2d/navigation_region_2d.cpp')
-rw-r--r-- | scene/2d/navigation_region_2d.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/scene/2d/navigation_region_2d.cpp b/scene/2d/navigation_region_2d.cpp index 78733f04e4..5463181e8e 100644 --- a/scene/2d/navigation_region_2d.cpp +++ b/scene/2d/navigation_region_2d.cpp @@ -35,6 +35,10 @@ #include "scene/resources/world_2d.h" #include "servers/navigation_server_2d.h" +RID NavigationRegion2D::get_rid() const { + return region; +} + void NavigationRegion2D::set_enabled(bool p_enabled) { if (enabled == p_enabled) { return; @@ -136,7 +140,7 @@ real_t NavigationRegion2D::get_travel_cost() const { } RID NavigationRegion2D::get_region_rid() const { - return region; + return get_rid(); } #ifdef TOOLS_ENABLED @@ -279,6 +283,8 @@ PackedStringArray NavigationRegion2D::get_configuration_warnings() const { } void NavigationRegion2D::_bind_methods() { + ClassDB::bind_method(D_METHOD("get_rid"), &NavigationRegion2D::get_rid); + ClassDB::bind_method(D_METHOD("set_navigation_polygon", "navigation_polygon"), &NavigationRegion2D::set_navigation_polygon); ClassDB::bind_method(D_METHOD("get_navigation_polygon"), &NavigationRegion2D::get_navigation_polygon); @@ -356,6 +362,9 @@ NavigationRegion2D::NavigationRegion2D() { NavigationServer2D::get_singleton()->region_set_owner_id(region, get_instance_id()); NavigationServer2D::get_singleton()->region_set_enter_cost(region, get_enter_cost()); NavigationServer2D::get_singleton()->region_set_travel_cost(region, get_travel_cost()); + NavigationServer2D::get_singleton()->region_set_navigation_layers(region, navigation_layers); + NavigationServer2D::get_singleton()->region_set_use_edge_connections(region, use_edge_connections); + NavigationServer2D::get_singleton()->region_set_enabled(region, enabled); #ifdef DEBUG_ENABLED NavigationServer2D::get_singleton()->connect(SNAME("map_changed"), callable_mp(this, &NavigationRegion2D::_navigation_map_changed)); |