Browse Source

Lookup method also in base scripts of a PlaceHolderScriptInstance

Raul Santos 1 year ago
parent
commit
175e5bcf4e
1 changed files with 7 additions and 1 deletions
  1. 7 1
      core/object/script_language.cpp

+ 7 - 1
core/object/script_language.cpp

@@ -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;
 }