summaryrefslogtreecommitdiff
path: root/core/object/class_db.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-11-06 15:57:49 +0100
committerRémi Verschelde <rverschelde@gmail.com>2022-11-06 15:57:49 +0100
commite95dec0c64a529ec59d485278b9a600fcb85f608 (patch)
treefbb565d4b931adfb1ae143518f50015f11937c20 /core/object/class_db.cpp
parent12b4a263ee3dd9b5a8ffba28b4e5abecc2b4f328 (diff)
parent2557ea9d33489ebca24e8840a77bfee821c8b1a0 (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/class_db.cpp')
-rw-r--r--core/object/class_db.cpp8
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;