diff options
Diffstat (limited to 'scene/main/node.cpp')
-rw-r--r-- | scene/main/node.cpp | 11 |
1 files changed, 7 insertions, 4 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) { |