diff options
author | rune-scape <allie.smith.epic@gmail.com> | 2022-11-25 05:21:15 -0500 |
---|---|---|
committer | rune-scape <allie.smith.epic@gmail.com> | 2022-11-27 03:55:53 -0500 |
commit | 847c9bd24832d51b1bbf763d445d2d57806486fe (patch) | |
tree | 288b895916c97cf36e39fc74225daf8a8eb91674 /editor/editor_data.cpp | |
parent | c7ceb94e372216b1b033d7c2ac26d5b7545c4dac (diff) | |
download | redot-engine-847c9bd24832d51b1bbf763d445d2d57806486fe.tar.gz |
GDScript: Avoid using `get_global_class_native_base`
Diffstat (limited to 'editor/editor_data.cpp')
-rw-r--r-- | editor/editor_data.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index 48be0c9c00..f15b874c45 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -945,11 +945,11 @@ StringName EditorData::script_class_get_base(const String &p_class) const { Variant EditorData::script_class_instance(const String &p_class) { if (ScriptServer::is_global_class(p_class)) { - Variant obj = ClassDB::instantiate(ScriptServer::get_global_class_native_base(p_class)); - if (obj) { - Ref<Script> script = script_class_load_script(p_class); - if (script.is_valid()) { - ((Object *)obj)->set_script(script); + Ref<Script> script = script_class_load_script(p_class); + if (script.is_valid()) { + Object *obj = ClassDB::instantiate(script->get_instance_base_type()); + if (obj) { + obj->set_script(script); } return obj; } |