summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorÁlex Román Núñez <eirexe123@gmail.com>2022-07-22 20:28:24 +0200
committerÁlex Román Núñez <eirexe123@gmail.com>2022-07-22 20:34:19 +0200
commit1b10f744e0214c296e626726b7fa0254e406bfc3 (patch)
tree17aced00ebe55b3eb59cd295095213db7c5b5ca9 /modules
parent79463aa5defb083569d193658a62755223f14dc4 (diff)
Fix typed array returns returning the incorrect contained type
Fixes #59485 and #60218
Diffstat (limited to 'modules')
-rw-r--r--modules/gdscript/gdscript_byte_codegen.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript_byte_codegen.cpp b/modules/gdscript/gdscript_byte_codegen.cpp
index 6a1effd680..7f7117a6d5 100644
--- a/modules/gdscript/gdscript_byte_codegen.cpp
+++ b/modules/gdscript/gdscript_byte_codegen.cpp
@@ -1596,7 +1596,7 @@ void GDScriptByteCodeGenerator::write_return(const Address &p_return_value) {
// Typed array.
const GDScriptDataType &element_type = function->return_type.get_container_element_type();
- Variant script = function->return_type.script_type;
+ Variant script = element_type.script_type;
int script_idx = get_constant_pos(script) | (GDScriptFunction::ADDR_TYPE_CONSTANT << GDScriptFunction::ADDR_BITS);
append(GDScriptFunction::OPCODE_RETURN_TYPED_ARRAY, 2);