diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-05-28 15:49:23 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-05-28 15:49:23 +0200 |
commit | 760e30a4deda8c1d95cc8c955775e9d260c04366 (patch) | |
tree | a7c529d7b3bc03433356362c7fa39c47a208a545 | |
parent | 194b1c478d3868bf0cfb4edff93535ca484e643b (diff) | |
parent | e312f147aa7f34b946c3f21d20f38c17291952d3 (diff) | |
download | redot-engine-760e30a4deda8c1d95cc8c955775e9d260c04366.tar.gz |
Merge pull request #92345 from mihe/classdb-extension-editor-classes
Fix `ClassDB` not checking for editor classes properly
-rw-r--r-- | core/object/class_db.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/object/class_db.cpp b/core/object/class_db.cpp index 3d93ce8e73..fe4345aa0d 100644 --- a/core/object/class_db.cpp +++ b/core/object/class_db.cpp @@ -505,7 +505,7 @@ Object *ClassDB::_instantiate_internal(const StringName &p_class, bool p_require ERR_FAIL_NULL_V_MSG(ti->creation_func, nullptr, "Class '" + String(p_class) + "' or its base class cannot be instantiated."); } #ifdef TOOLS_ENABLED - if (ti->api == API_EDITOR && !Engine::get_singleton()->is_editor_hint()) { + if ((ti->api == API_EDITOR || ti->api == API_EDITOR_EXTENSION) && !Engine::get_singleton()->is_editor_hint()) { ERR_PRINT("Class '" + String(p_class) + "' can only be instantiated by editor."); return nullptr; } @@ -664,7 +664,7 @@ bool ClassDB::can_instantiate(const StringName &p_class) { return scr.is_valid() && scr->is_valid() && !scr->is_abstract(); } #ifdef TOOLS_ENABLED - if (ti->api == API_EDITOR && !Engine::get_singleton()->is_editor_hint()) { + if ((ti->api == API_EDITOR || ti->api == API_EDITOR_EXTENSION) && !Engine::get_singleton()->is_editor_hint()) { return false; } #endif @@ -684,7 +684,7 @@ bool ClassDB::is_virtual(const StringName &p_class) { return scr.is_valid() && scr->is_valid() && scr->is_abstract(); } #ifdef TOOLS_ENABLED - if (ti->api == API_EDITOR && !Engine::get_singleton()->is_editor_hint()) { + if ((ti->api == API_EDITOR || ti->api == API_EDITOR_EXTENSION) && !Engine::get_singleton()->is_editor_hint()) { return false; } #endif |