Merge pull request #60628 from KoBeWi/first_among_us

This commit is contained in:
Rémi Verschelde 2022-04-29 18:03:19 +02:00 committed by GitHub
commit 63addc3286
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -91,6 +91,7 @@
<return type="Node" />
<argument index="0" name="group" type="StringName" />
<description>
Returns the first node in the specified group, or [code]null[/code] if the group is empty or does not exist.
</description>
</method>
<method name="get_frame" qualifiers="const">

View file

@ -981,12 +981,12 @@ bool SceneTree::has_group(const StringName &p_identifier) const {
Node *SceneTree::get_first_node_in_group(const StringName &p_group) {
Map<StringName, Group>::Element *E = group_map.find(p_group);
if (!E) {
return nullptr; //no group
return nullptr; // No group.
}
_update_group_order(E->get()); //update order just in case
_update_group_order(E->get()); // Update order just in case.
if (E->get().nodes.size() == 0) {
if (E->get().nodes.is_empty()) {
return nullptr;
}