summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Nations <willnationsdev@gmail.com>2018-10-16 13:42:06 -0500
committerWill Nations <willnationsdev@gmail.com>2018-10-16 13:47:12 -0500
commit372f82e7a76c17241afbe51bb2a717a858d1ff7b (patch)
treecfe465513a38472a893a5caf1756973ffe4573b5
parent0dbe01483a902c49ecedf4fd36b74353424145a5 (diff)
Fix Script -> Script Class not in CreateDialog
-rw-r--r--editor/editor_data.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp
index 9420452da1..501382e972 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;
}