summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorMicky <micheledevita2@gmail.com>2022-10-09 00:10:00 +0200
committerMicky <micheledevita2@gmail.com>2022-10-09 12:34:19 +0200
commitbf64a068a40478838733190fd2c21b5dbace5457 (patch)
tree0e57a2e3088fded5ab8245cacf42f7ffd6aef053 /core
parent880a0177d12463b612268afe95bd3d8dd565bf52 (diff)
Fix Array.`slice()` and `filter()` forgetting Typed Array
Diffstat (limited to 'core')
-rw-r--r--core/variant/array.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/variant/array.cpp b/core/variant/array.cpp
index c1bdd6a6bc..8b958814db 100644
--- a/core/variant/array.cpp
+++ b/core/variant/array.cpp
@@ -402,6 +402,7 @@ Array Array::recursive_duplicate(bool p_deep, int recursion_count) const {
Array Array::slice(int p_begin, int p_end, int p_step, bool p_deep) const {
Array result;
+ result._p->typed = _p->typed;
ERR_FAIL_COND_V_MSG(p_step == 0, result, "Slice step cannot be zero.");
@@ -433,6 +434,7 @@ Array Array::slice(int p_begin, int p_end, int p_step, bool p_deep) const {
Array Array::filter(const Callable &p_callable) const {
Array new_arr;
new_arr.resize(size());
+ new_arr._p->typed = _p->typed;
int accepted_count = 0;
const Variant *argptrs[1];