Fixing #1127 by making return types of auto-generated functions dynamic

This commit is contained in:
Mathis-Z
2023-05-30 22:35:05 +02:00
parent aef9ea7387
commit ac98dd2752
4 changed files with 13 additions and 1 deletions

View File

@@ -1799,7 +1799,10 @@ def generate_utility_functions(api, output_dir):
arguments.append(arg_name)
function_call += ", ".join(arguments)
else:
source.append("\tVariant ret;")
if has_return:
source.append(f'\t{get_gdextension_type(correct_type(function["return_type"]))} ret;')
else:
source.append("\tVariant ret;")
function_call += "___function(&ret, reinterpret_cast<GDExtensionConstVariantPtr *>(args), arg_count"
function_call += ");"