mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
-Fixed changes to default input actions not working, closes #10502
-Added Array.duplicate() method, needed to fix above
This commit is contained in:
parent
0b8fa1e010
commit
c771e03ee2
4 changed files with 19 additions and 4 deletions
|
@ -210,6 +210,17 @@ const Variant &Array::get(int p_idx) const {
|
|||
return operator[](p_idx);
|
||||
}
|
||||
|
||||
Array Array::duplicate() const {
|
||||
|
||||
Array new_arr;
|
||||
int element_count = size();
|
||||
new_arr.resize(element_count);
|
||||
for (int i = 0; i < element_count; i++) {
|
||||
new_arr[i] = get(i);
|
||||
}
|
||||
|
||||
return new_arr;
|
||||
}
|
||||
struct _ArrayVariantSort {
|
||||
|
||||
_FORCE_INLINE_ bool operator()(const Variant &p_l, const Variant &p_r) const {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue