1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-30 16:26:50 +00:00

Use ScriptServer::get_global_class_base instead of script_class_get_base in script_class_is_parent.

This commit is contained in:
Jason Knight
2022-02-07 11:37:48 -06:00
parent d35269ab21
commit 81b6da9d3d

View File

@@ -894,21 +894,12 @@ bool EditorData::script_class_is_parent(const String &p_class, const String &p_i
return false; return false;
} }
Ref<Script> script = script_class_load_script(p_class); String base = p_class;
if (script.is_null()) { while (base != p_inherits) {
return false;
}
String base = script_class_get_base(p_class);
Ref<Script> base_script = script->get_base_script();
while (p_inherits != base) {
if (ClassDB::class_exists(base)) { if (ClassDB::class_exists(base)) {
return ClassDB::is_parent_class(base, p_inherits); return ClassDB::is_parent_class(base, p_inherits);
} else if (ScriptServer::is_global_class(base)) { } else if (ScriptServer::is_global_class(base)) {
base = script_class_get_base(base); base = ScriptServer::get_global_class_base(base);
} else if (base_script.is_valid()) {
return ClassDB::is_parent_class(base_script->get_instance_base_type(), p_inherits);
} else { } else {
return false; return false;
} }