Skip to content

Commit ded2a4a

Browse files
committed
Merge pull request godotengine#93452 from raulsntos/core/placeholder-has-method
Lookup method also in base scripts of a PlaceHolderScriptInstance
2 parents e526f12 + 175e5bc commit ded2a4a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

core/object/script_language.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,13 @@ bool PlaceHolderScriptInstance::has_method(const StringName &p_method) const {
697697
}
698698

699699
if (script.is_valid()) {
700-
return script->has_method(p_method);
700+
Ref<Script> scr = script;
701+
while (scr.is_valid()) {
702+
if (scr->has_method(p_method)) {
703+
return true;
704+
}
705+
scr = scr->get_base_script();
706+
}
701707
}
702708
return false;
703709
}

0 commit comments

Comments
 (0)