Fix enum return value size.

pull/987/head
bruvzg 2023-01-07 00:48:40 +02:00
parent 3da6db4fe4
commit 18eed144ca
No known key found for this signature in database
GPG Key ID: 7960FCF39844EC38
1 changed files with 6 additions and 1 deletions

View File

@ -1363,7 +1363,12 @@ def generate_engine_class_source(class_api, used_classes, fully_used_classes, us
if has_return: if has_return:
return_type = method["return_value"]["type"] return_type = method["return_value"]["type"]
meta_type = method["return_value"]["meta"] if "meta" in method["return_value"] else None meta_type = method["return_value"]["meta"] if "meta" in method["return_value"] else None
if is_pod_type(return_type) or is_variant(return_type) or is_enum(return_type): if is_enum(return_type):
if method["is_static"]:
method_call += f"return ({get_gdextension_type(correct_type(return_type, meta_type))})internal::_call_native_mb_ret<int64_t>(___method_bind, nullptr"
else:
method_call += f"return ({get_gdextension_type(correct_type(return_type, meta_type))})internal::_call_native_mb_ret<int64_t>(___method_bind, _owner"
elif is_pod_type(return_type) or is_variant(return_type):
if method["is_static"]: if method["is_static"]:
method_call += f"return internal::_call_native_mb_ret<{get_gdextension_type(correct_type(return_type, meta_type))}>(___method_bind, nullptr" method_call += f"return internal::_call_native_mb_ret<{get_gdextension_type(correct_type(return_type, meta_type))}>(___method_bind, nullptr"
else: else: