Merge pull request #100954 from Bromeon/bugfix/nodepath-slice
Fix `NodePath::slice()` incorrect behavior for subname indexing
This commit is contained in:
commit
ad74e337b9
2 changed files with 11 additions and 8 deletions
|
|
@ -255,7 +255,7 @@ NodePath NodePath::slice(int p_begin, int p_end) const {
|
|||
if (end < 0) {
|
||||
end += total_count;
|
||||
}
|
||||
const int sub_begin = MAX(begin - name_count - 1, 0);
|
||||
const int sub_begin = MAX(begin - name_count, 0);
|
||||
const int sub_end = MAX(end - name_count, 0);
|
||||
|
||||
const Vector<StringName> names = get_names().slice(begin, end);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue