diff options
author | Mikael Hermansson <mikael@hermansson.io> | 2024-05-25 00:23:12 +0200 |
---|---|---|
committer | Mikael Hermansson <mikael@hermansson.io> | 2024-05-25 00:23:12 +0200 |
commit | e312f147aa7f34b946c3f21d20f38c17291952d3 (patch) | |
tree | b8c6f975b69bb2fd1f2036fd38b61873f79c93db | |
parent | b7feebefabc2d48b0d4794cd31fc141f1caecc5c (diff) | |
download | redot-engine-e312f147aa7f34b946c3f21d20f38c17291952d3.tar.gz |
Fix `ClassDB` not checking for `API_EDITOR_EXTENSION`
-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 |