diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-11-28 11:02:43 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-11-28 11:02:43 +0100 |
commit | c3920936681b68dc42e259a206dac726fd240d10 (patch) | |
tree | 43bf1e9d128ec8cbf2a213cae39499a50680aed6 /main | |
parent | be0923b1d98cec6605baca0be8c9bf65c1ed996f (diff) | |
parent | 847c9bd24832d51b1bbf763d445d2d57806486fe (diff) |
Merge pull request #69272 from rune-scape/rune-avoid-global-base
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 5a640a9d55..d857c93b73 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) { |