Skip to content

Commit

Permalink
Merge pull request godotengine#93452 from raulsntos/core/placeholder-…
Browse files Browse the repository at this point in the history
…has-method

Lookup method also in base scripts of a PlaceHolderScriptInstance
  • Loading branch information
akien-mga committed Jun 22, 2024
2 parents e526f12 + 175e5bc commit ded2a4a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion core/object/script_language.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit ded2a4a

Please sign in to comment.