summaryrefslogtreecommitdiff
path: root/modules/navigation
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-06-23 16:14:12 +0200
committerGitHub <noreply@github.com>2022-06-23 16:14:12 +0200
commit462127eff08c8ca60a1e4a476153bdb60d63b890 (patch)
tree53118f6463d0a24ff1173bc112efc403c6b063cb /modules/navigation
parentbdd41a836c50ac1e69113a7e284ed2a2f72fc379 (diff)
parentc0fed1d4e886539a533fc77e58bd4c2e1ae17597 (diff)
Merge pull request #62312 from smix8/navigation_get_maps_4.x
Diffstat (limited to 'modules/navigation')
-rw-r--r--modules/navigation/godot_navigation_server.cpp12
-rw-r--r--modules/navigation/godot_navigation_server.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/modules/navigation/godot_navigation_server.cpp b/modules/navigation/godot_navigation_server.cpp
index 2f8cb6c230..927748dbd9 100644
--- a/modules/navigation/godot_navigation_server.cpp
+++ b/modules/navigation/godot_navigation_server.cpp
@@ -123,6 +123,18 @@ void GodotNavigationServer::add_command(SetCommand *command) const {
}
}
+Array GodotNavigationServer::get_maps() const {
+ Array all_map_rids;
+ List<RID> maps_owned;
+ map_owner.get_owned_list(&maps_owned);
+ if (maps_owned.size()) {
+ for (const RID &E : maps_owned) {
+ all_map_rids.push_back(E);
+ }
+ }
+ return all_map_rids;
+}
+
RID GodotNavigationServer::map_create() const {
GodotNavigationServer *mut_this = const_cast<GodotNavigationServer *>(this);
MutexLock lock(mut_this->operations_mutex);
diff --git a/modules/navigation/godot_navigation_server.h b/modules/navigation/godot_navigation_server.h
index d931dbaee0..d4306e7931 100644
--- a/modules/navigation/godot_navigation_server.h
+++ b/modules/navigation/godot_navigation_server.h
@@ -85,6 +85,8 @@ public:
void add_command(SetCommand *command) const;
+ virtual Array get_maps() const override;
+
virtual RID map_create() const override;
COMMAND_2(map_set_active, RID, p_map, bool, p_active);
virtual bool map_is_active(RID p_map) const override;