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 /main | |
parent | c7ceb94e372216b1b033d7c2ac26d5b7545c4dac (diff) |
GDScript: Avoid using `get_global_class_native_base`
Diffstat (limited to 'main')
-rw-r--r-- | main/main.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/main/main.cpp b/main/main.cpp index 460c73ceee..d8890e1f6e 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -2660,7 +2660,11 @@ bool Main::start() { if (!editor && !ClassDB::class_exists(main_loop_type) && ScriptServer::is_global_class(main_loop_type)) { String script_path = ScriptServer::get_global_class_path(main_loop_type); Ref<Script> script_res = ResourceLoader::load(script_path); - StringName script_base = ScriptServer::get_global_class_native_base(main_loop_type); + if (script_res.is_null()) { + OS::get_singleton()->alert("Error: Could not load MainLoop script type: " + main_loop_type); + ERR_FAIL_V_MSG(false, vformat("Could not load global class %s.", main_loop_type)); + } + StringName script_base = script_res->get_instance_base_type(); Object *obj = ClassDB::instantiate(script_base); MainLoop *script_loop = Object::cast_to<MainLoop>(obj); if (!script_loop) { |