summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_autoload_settings.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp
index fad76682b5..362c4c3457 100644
--- a/editor/editor_autoload_settings.cpp
+++ b/editor/editor_autoload_settings.cpp
@@ -78,6 +78,14 @@ bool EditorAutoloadSettings::_autoload_name_is_valid(const String &p_name, Strin
return false;
}
+ if (ScriptServer::is_global_class(p_name)) {
+ if (r_error) {
+ *r_error = TTR("Invalid name.") + "\n" + TTR("Must not collide with an existing global script class name.");
+ }
+
+ return false;
+ }
+
for (int i = 0; i < Variant::VARIANT_MAX; i++) {
if (Variant::get_type_name(Variant::Type(i)) == p_name) {
if (r_error) {