diff options
author | Faymoon <mercier.mateo@orange.fr> | 2020-04-21 15:18:50 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2021-07-13 10:44:53 +0200 |
commit | 78ead60372c3342b15767265c0b0c976658ebc35 (patch) | |
tree | 0b9c259378ef5da3e918a249817de711d5d4d7b7 /core/core_bind.cpp | |
parent | f2ad067509865f524497175fca600300dae8b7d8 (diff) | |
download | redot-engine-78ead60372c3342b15767265c0b0c976658ebc35.tar.gz |
Let thread func have optional parameter
Fixes #38042.
Diffstat (limited to 'core/core_bind.cpp')
-rw-r--r-- | core/core_bind.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/core_bind.cpp b/core/core_bind.cpp index a3349444c4..9a58528bd7 100644 --- a/core/core_bind.cpp +++ b/core/core_bind.cpp @@ -1729,10 +1729,11 @@ void _Thread::_start_func(void *ud) { memdelete(tud); Callable::CallError ce; const Variant *arg[1] = { &t->userdata }; + int argc = (int)(arg[0]->get_type() != Variant::NIL); Thread::set_name(t->target_method); - t->ret = t->target_instance->call(t->target_method, arg, 1, ce); + t->ret = t->target_instance->call(t->target_method, arg, argc, ce); if (ce.error != Callable::CallError::CALL_OK) { String reason; switch (ce.error) { |