Made get_child support negative indexes, with documentation
This commit is contained in:
@@ -1327,6 +1327,9 @@ int Node::get_child_count() const {
|
||||
}
|
||||
|
||||
Node *Node::get_child(int p_index) const {
|
||||
if (p_index < 0) {
|
||||
p_index += data.children.size();
|
||||
}
|
||||
ERR_FAIL_INDEX_V(p_index, data.children.size(), nullptr);
|
||||
|
||||
return data.children[p_index];
|
||||
|
||||
Reference in New Issue
Block a user