diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-06-24 10:13:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-24 10:13:07 +0200 |
commit | faae24637cdf8ce50e06e9968342003fcd2ca470 (patch) | |
tree | ac985c8d17c80dc0a80e0cc87ec8ee3d31ea6656 /modules | |
parent | 49d87488481404606a1292c6a3f9c96b1c2122b6 (diff) | |
parent | fdea2698053b616d0805ef3c4501a76945ce82ef (diff) |
Merge pull request #62300 from smix8/navigation_map_force_update_4.x
Diffstat (limited to 'modules')
-rw-r--r-- | modules/navigation/godot_navigation_server.cpp | 9 | ||||
-rw-r--r-- | modules/navigation/godot_navigation_server.h | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/modules/navigation/godot_navigation_server.cpp b/modules/navigation/godot_navigation_server.cpp index e243770cd2..bcbc721dbb 100644 --- a/modules/navigation/godot_navigation_server.cpp +++ b/modules/navigation/godot_navigation_server.cpp @@ -602,6 +602,15 @@ void GodotNavigationServer::flush_queries() { commands.clear(); } +void GodotNavigationServer::map_force_update(RID p_map) { + NavMap *map = map_owner.get_or_null(p_map); + ERR_FAIL_COND(map == nullptr); + + flush_queries(); + + map->sync(); +} + void GodotNavigationServer::process(real_t p_delta_time) { flush_queries(); diff --git a/modules/navigation/godot_navigation_server.h b/modules/navigation/godot_navigation_server.h index 48c8dcbeb2..8e7e99888c 100644 --- a/modules/navigation/godot_navigation_server.h +++ b/modules/navigation/godot_navigation_server.h @@ -110,6 +110,8 @@ public: virtual Array map_get_regions(RID p_map) const override; virtual Array map_get_agents(RID p_map) const override; + virtual void map_force_update(RID p_map) override; + virtual RID region_create() const override; COMMAND_2(region_set_enter_cost, RID, p_region, real_t, p_enter_cost); |