diff options
Diffstat (limited to 'scene/main')
-rw-r--r-- | scene/main/node.cpp | 11 | ||||
-rw-r--r-- | scene/main/node.h | 2 |
2 files changed, 8 insertions, 5 deletions
diff --git a/scene/main/node.cpp b/scene/main/node.cpp index 0aaba5491a..0b3a193d18 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -1716,14 +1716,17 @@ void Node::get_groups(List<GroupInfo> *p_groups) const { } } -bool Node::has_persistent_groups() const { +int Node::get_persistent_group_count() const { + + int count = 0; for (const Map<StringName, GroupData>::Element *E = data.grouped.front(); E; E = E->next()) { - if (E->get().persistent) - return true; + if (E->get().persistent) { + count += 1; + } } - return false; + return count; } void Node::_print_tree_pretty(const String &prefix, const bool last) { diff --git a/scene/main/node.h b/scene/main/node.h index 982bfcd620..67b40f6dfc 100644 --- a/scene/main/node.h +++ b/scene/main/node.h @@ -300,7 +300,7 @@ public: }; void get_groups(List<GroupInfo> *p_groups) const; - bool has_persistent_groups() const; + int get_persistent_group_count() const; void move_child(Node *p_child, int p_pos); void raise(); |