You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Disallow class names to be the same as global names
Also forbid autoloads to have the same name as global script class.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user