diff options
author | Spartan322 <Megacake1234@gmail.com> | 2024-11-02 03:14:40 -0400 |
---|---|---|
committer | Spartan322 <Megacake1234@gmail.com> | 2024-11-02 03:22:12 -0400 |
commit | a684ee1dec108bb1a050f07ec3dd73fd5ef02dbc (patch) | |
tree | e9de2ee4820e24a159d2c06b1ace11f89c4e97c4 /core/extension/extension_api_dump.cpp | |
parent | 3302f803aa4ea09b16a8824ca3bea33f3e2b48ba (diff) | |
parent | c6c464cf9ae56e8b68620af65125dd980d0e8122 (diff) | |
download | redot-engine-a684ee1dec108bb1a050f07ec3dd73fd5ef02dbc.tar.gz |
Merge commit godotengine/godot@c6c464cf9ae56e8b68620af65125dd980d0e8122
Diffstat (limited to 'core/extension/extension_api_dump.cpp')
-rw-r--r-- | core/extension/extension_api_dump.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/core/extension/extension_api_dump.cpp b/core/extension/extension_api_dump.cpp index 2033ff2b43..b70bd23918 100644 --- a/core/extension/extension_api_dump.cpp +++ b/core/extension/extension_api_dump.cpp @@ -1366,7 +1366,7 @@ static bool compare_dict_array(const Dictionary &p_old_api, const Dictionary &p_ return true; // May just not have this array and its still good. Probably added recently. } bool failed = false; - ERR_FAIL_COND_V_MSG(!p_new_api.has(p_base_array), false, "New API lacks base array: " + p_base_array); + ERR_FAIL_COND_V_MSG(!p_new_api.has(p_base_array), false, vformat("New API lacks base array: %s", p_base_array)); Array new_api = p_new_api[p_base_array]; HashMap<String, Dictionary> new_api_assoc; @@ -1374,6 +1374,9 @@ static bool compare_dict_array(const Dictionary &p_old_api, const Dictionary &p_ Dictionary elem = var; ERR_FAIL_COND_V_MSG(!elem.has(p_name_field), false, vformat("Validate extension JSON: Element of base_array '%s' is missing field '%s'. This is a bug.", base_array, p_name_field)); String name = elem[p_name_field]; + if (name.is_valid_float()) { + name = name.trim_suffix(".0"); // Make "integers" stringified as integers. + } if (p_compare_operators && elem.has("right_type")) { name += " " + String(elem["right_type"]); } @@ -1389,6 +1392,9 @@ static bool compare_dict_array(const Dictionary &p_old_api, const Dictionary &p_ continue; } String name = old_elem[p_name_field]; + if (name.is_valid_float()) { + name = name.trim_suffix(".0"); // Make "integers" stringified as integers. + } if (p_compare_operators && old_elem.has("right_type")) { name += " " + String(old_elem["right_type"]); } @@ -1518,7 +1524,7 @@ static bool compare_sub_dict_array(HashSet<String> &r_removed_classes_registered return true; // May just not have this array and its still good. Probably added recently or optional. } bool failed = false; - ERR_FAIL_COND_V_MSG(!p_new_api.has(p_outer), false, "New API lacks base array: " + p_outer); + ERR_FAIL_COND_V_MSG(!p_new_api.has(p_outer), false, vformat("New API lacks base array: %s", p_outer)); Array new_api = p_new_api[p_outer]; HashMap<String, Dictionary> new_api_assoc; |