You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-23 15:16:17 +00:00
Fix Array.slice() and filter() forgetting Typed Array
This commit is contained in:
@@ -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 Array::slice(int p_begin, int p_end, int p_step, bool p_deep) const {
|
||||||
Array result;
|
Array result;
|
||||||
|
result._p->typed = _p->typed;
|
||||||
|
|
||||||
ERR_FAIL_COND_V_MSG(p_step == 0, result, "Slice step cannot be zero.");
|
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 Array::filter(const Callable &p_callable) const {
|
||||||
Array new_arr;
|
Array new_arr;
|
||||||
new_arr.resize(size());
|
new_arr.resize(size());
|
||||||
|
new_arr._p->typed = _p->typed;
|
||||||
int accepted_count = 0;
|
int accepted_count = 0;
|
||||||
|
|
||||||
const Variant *argptrs[1];
|
const Variant *argptrs[1];
|
||||||
|
|||||||
Reference in New Issue
Block a user