Open rktprof opened 5 months ago
Thank you for this bug report!
The issue is that SwiftGodot does not currently register methods with default argument values.
The following fixes need to take place:
ClassServices.registerMethod
to take an array of Default values, and pass this to classdb_register_extension_class_method
, currently, we hardcode this to zero
Describe the bug I get a runtime index out of range error in a @Callable function with default parameters (see screenshots). This only happens if I call the function from GDScript with
findPlayers(2, 2)
and not when filling out all the parametersfindPlayers(2, 2, 0, 0)
Also tested this with just one default parameter.
To Reproduce
Expected behavior Default values should be used if they are not supplied
Screenshots Original function:
Runtime error:
Additional context I've only tested this on iOS but I don't see why it would be device exclusive