diff options
author | Jason Knight <jason@winterpixel.com> | 2022-02-07 11:37:48 -0600 |
---|---|---|
committer | Jason Knight <jason@winterpixel.com> | 2022-02-07 11:37:48 -0600 |
commit | 81b6da9d3db46b0043052330ea97dffe15902dae (patch) | |
tree | 6ed8a65e1772816149257f0cabb14e1d5d7d8776 /editor | |
parent | d35269ab21451a88331844b2098d4e9e20d43fc5 (diff) |
Use ScriptServer::get_global_class_base instead of script_class_get_base in script_class_is_parent.
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_data.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index 7a0a4abbff..ee53f4b343 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -894,21 +894,12 @@ bool EditorData::script_class_is_parent(const String &p_class, const String &p_i return false; } - Ref<Script> script = script_class_load_script(p_class); - if (script.is_null()) { - return false; - } - - String base = script_class_get_base(p_class); - Ref<Script> base_script = script->get_base_script(); - - while (p_inherits != base) { + String base = p_class; + while (base != p_inherits) { if (ClassDB::class_exists(base)) { return ClassDB::is_parent_class(base, p_inherits); } else if (ScriptServer::is_global_class(base)) { - base = script_class_get_base(base); - } else if (base_script.is_valid()) { - return ClassDB::is_parent_class(base_script->get_instance_base_type(), p_inherits); + base = ScriptServer::get_global_class_base(base); } else { return false; } |