mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-12-27 06:07:14 +01:00
Check thread func in base scripts for argument info
This commit is contained in:
parent
11a92cfe27
commit
1d2b59b941
@ -2698,12 +2698,18 @@ void _Thread::_start_func(void *ud) {
|
|||||||
// We must check if we are in case b).
|
// We must check if we are in case b).
|
||||||
int target_param_count = 0;
|
int target_param_count = 0;
|
||||||
int target_default_arg_count = 0;
|
int target_default_arg_count = 0;
|
||||||
|
|
||||||
Ref<Script> script = target_instance->get_script();
|
Ref<Script> script = target_instance->get_script();
|
||||||
if (script.is_valid()) {
|
while (script.is_valid()) {
|
||||||
|
if (script->has_method(t->target_method)) {
|
||||||
MethodInfo mi = script->get_method_info(t->target_method);
|
MethodInfo mi = script->get_method_info(t->target_method);
|
||||||
target_param_count = mi.arguments.size();
|
target_param_count = mi.arguments.size();
|
||||||
target_default_arg_count = mi.default_arguments.size();
|
target_default_arg_count = mi.default_arguments.size();
|
||||||
} else {
|
break;
|
||||||
|
}
|
||||||
|
script = script->get_base_script();
|
||||||
|
}
|
||||||
|
if (script.is_null()) {
|
||||||
MethodBind *method = ClassDB::get_method(target_instance->get_class_name(), t->target_method);
|
MethodBind *method = ClassDB::get_method(target_instance->get_class_name(), t->target_method);
|
||||||
if (method) {
|
if (method) {
|
||||||
target_param_count = method->get_argument_count();
|
target_param_count = method->get_argument_count();
|
||||||
|
Loading…
Reference in New Issue
Block a user