Fix typed array returns returning the incorrect contained type

Fixes #59485 and #60218
This commit is contained in:
Álex Román Núñez 2022-07-22 20:28:24 +02:00
parent 79463aa5de
commit 1b10f744e0

View file

@ -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);