From b1362141e218ae45204925fd78aa3527bfb9cfbd Mon Sep 17 00:00:00 2001 From: Relintai Date: Sun, 15 Jan 2023 17:09:46 +0100 Subject: [PATCH] Unly call module editor initialization level when the editor hint is set. --- main/main.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/main/main.cpp b/main/main.cpp index 113ae158d..a1bbfd46d 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -1520,7 +1520,7 @@ Error Main::setup2(Thread::ID p_main_tid_override) { MAIN_PRINT("Main: Load Modules, Physics, Drivers, Scripts"); register_platform_apis(); - + register_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_START); register_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_SINGLETON); register_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_CORE); @@ -1528,7 +1528,9 @@ Error Main::setup2(Thread::ID p_main_tid_override) { register_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_PLATFORM); register_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_SERVER); register_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_SCENE); - register_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_EDITOR); + if (Engine::get_singleton()->is_editor_hint()) { + register_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_EDITOR); + } //register_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_TEST); register_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_FINALIZE); @@ -2453,7 +2455,9 @@ void Main::cleanup(bool p_force) { unregister_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_START); //unregister_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_TEST); - unregister_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_EDITOR); + if (Engine::get_singleton()->is_editor_hint()) { + unregister_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_EDITOR); + } unregister_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_SCENE); unregister_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_SERVER); unregister_module_types(ModuleRegistrationLevel::MODULE_REGISTRATION_LEVEL_PLATFORM);