From bf64a068a40478838733190fd2c21b5dbace5457 Mon Sep 17 00:00:00 2001 From: Micky Date: Sun, 9 Oct 2022 00:10:00 +0200 Subject: Fix Array.`slice()` and `filter()` forgetting Typed Array --- core/variant/array.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'core/variant') 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]; -- cgit v1.2.3