diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-11-06 15:57:49 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-11-06 15:57:49 +0100 |
commit | e95dec0c64a529ec59d485278b9a600fcb85f608 (patch) | |
tree | fbb565d4b931adfb1ae143518f50015f11937c20 /core/object | |
parent | 12b4a263ee3dd9b5a8ffba28b4e5abecc2b4f328 (diff) | |
parent | 2557ea9d33489ebca24e8840a77bfee821c8b1a0 (diff) |
Merge pull request #67614 from aaronfranke/virtually-virtual
Don't allow instancing virtual node types in the Create New Node dialog
Diffstat (limited to 'core/object')
-rw-r--r-- | core/object/class_db.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/core/object/class_db.cpp b/core/object/class_db.cpp index 41585943b3..0863dea053 100644 --- a/core/object/class_db.cpp +++ b/core/object/class_db.cpp @@ -31,6 +31,7 @@ #include "class_db.h" #include "core/config/engine.h" +#include "core/object/script_language.h" #include "core/os/mutex.h" #include "core/version.h" @@ -376,7 +377,12 @@ bool ClassDB::is_virtual(const StringName &p_class) { OBJTYPE_RLOCK; ClassInfo *ti = classes.getptr(p_class); - ERR_FAIL_COND_V_MSG(!ti, false, "Cannot get class '" + String(p_class) + "'."); + if (!ti) { + if (!ScriptServer::is_global_class(p_class)) { + ERR_FAIL_V_MSG(false, "Cannot get class '" + String(p_class) + "'."); + } + return false; + } #ifdef TOOLS_ENABLED if (ti->api == API_EDITOR && !Engine::get_singleton()->is_editor_hint()) { return false; |