summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-01-12 17:19:51 +0100
committerRémi Verschelde <rverschelde@gmail.com>2023-01-12 17:19:51 +0100
commitdef592114f64262d7323644b92648d83ae8f6a51 (patch)
tree868bf9c03be0df1e86b59ce29bd8f7f655e1ff91 /editor
parentd20ebe98c4f88b8cd845c71bbfa3b9b8e5d90e99 (diff)
parent274d49790dd2d68828a312e2c0802c1dbf09ac8f (diff)
Merge pull request #70700 from vonagam/fix-abstract-extends
GDScript: Fix extending abstract classes, forbid their construction
Diffstat (limited to 'editor')
-rw-r--r--editor/create_dialog.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp
index 6e701cb6bd..98fcde17c4 100644
--- a/editor/create_dialog.cpp
+++ b/editor/create_dialog.cpp
@@ -148,6 +148,11 @@ bool CreateDialog::_should_hide_type(const String &p_type) const {
return true;
}
+ StringName native_type = ScriptServer::get_global_class_native_base(p_type);
+ if (ClassDB::class_exists(native_type) && !ClassDB::can_instantiate(native_type)) {
+ return true;
+ }
+
String script_path = ScriptServer::get_global_class_path(p_type);
if (script_path.begins_with("res://addons/")) {
if (!EditorNode::get_singleton()->is_addon_plugin_enabled(script_path.get_slicec('/', 3))) {