summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorAaron Franke <arnfranke@yahoo.com>2022-10-19 01:58:13 -0500
committerAaron Franke <arnfranke@yahoo.com>2022-11-05 14:45:16 -0500
commitba542444e3f81498eb3a9851a1b17cbf828abe61 (patch)
tree36ad1dacef6e0e2d4cd43c1fb01a89f70668f233 /core
parent6882890a34528e056f13020798f4a473046990bb (diff)
Don't allow instancing virtual node types in the Create New Node dialog
Diffstat (limited to 'core')
-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;