1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-24 15:26:15 +00:00

Core: Fix JSON.{from,to}_native() issues

This commit is contained in:
Danil Alexeev
2024-11-27 18:15:49 +03:00
parent bbc54692c0
commit bd1a35ce9e
15 changed files with 1237 additions and 874 deletions

View File

@@ -112,14 +112,12 @@ bool EditorAutoloadSettings::_autoload_name_is_valid(const String &p_name, Strin
return false;
}
for (int i = 0; i < Variant::VARIANT_MAX; i++) {
if (Variant::get_type_name(Variant::Type(i)) == p_name) {
if (r_error) {
*r_error = TTR("Invalid name.") + " " + TTR("Must not collide with an existing built-in type name.");
}
return false;
if (Variant::get_type_by_name(p_name) < Variant::VARIANT_MAX) {
if (r_error) {
*r_error = TTR("Invalid name.") + " " + TTR("Must not collide with an existing built-in type name.");
}
return false;
}
for (int i = 0; i < CoreConstants::get_global_constant_count(); i++) {