diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-11-26 10:52:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-26 10:52:52 +0100 |
commit | af92b7dc14a7b6c8b14b6e7ad076ac6734e1efb0 (patch) | |
tree | 1063bdad1454e6f7a2e61aede9f6f296fb308816 /editor | |
parent | 9f50cbc6ed1af40278f3d62c5e05ff1384738fca (diff) | |
parent | 372f82e7a76c17241afbe51bb2a717a858d1ff7b (diff) |
Merge pull request #23060 from willnationsdev/inherit-non-class-script
Fix Script -> Script Class not in CreateDialog
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_data.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index bd6ce797b5..5942348999 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -857,11 +857,16 @@ bool EditorData::script_class_is_parent(const String &p_class, const String &p_i if (!ScriptServer::is_global_class(p_class)) return false; String base = script_class_get_base(p_class); + Ref<Script> script = ResourceLoader::load(ScriptServer::get_global_class_path(p_class), "Script"); + Ref<Script> base_script = script->get_base_script(); + while (p_inherits != base) { 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); } else { return false; } |