Lookup method also in base scripts of a PlaceHolderScriptInstance

This commit is contained in:
Raul Santos 2024-06-22 08:05:46 +02:00
parent 8a6c1e8f52
commit 175e5bcf4e
No known key found for this signature in database
GPG Key ID: B532473AE3A803E4
1 changed files with 7 additions and 1 deletions

View File

@ -697,7 +697,13 @@ bool PlaceHolderScriptInstance::has_method(const StringName &p_method) const {
}
if (script.is_valid()) {
return script->has_method(p_method);
Ref<Script> scr = script;
while (scr.is_valid()) {
if (scr->has_method(p_method)) {
return true;
}
scr = scr->get_base_script();
}
}
return false;
}