Fix method hashes with default arguments

This commit is contained in:
David Snopek
2023-09-10 12:36:44 -05:00
parent fc99492d30
commit 0d13727c97
7 changed files with 937 additions and 8 deletions

View File

@ -221,10 +221,11 @@ uint32_t ClassDB::get_api_hash(APIType p_api) {
hash = hash_murmur3_one_64(mb->get_default_argument_count(), hash);
for (int i = 0; i < mb->get_default_argument_count(); i++) {
//hash should not change, i hope for tis
Variant da = mb->get_default_argument(i);
hash = hash_murmur3_one_64(da.hash(), hash);
for (int i = 0; i < mb->get_argument_count(); i++) {
if (mb->has_default_argument(i)) {
Variant da = mb->get_default_argument(i);
hash = hash_murmur3_one_64(da.hash(), hash);
}
}
hash = hash_murmur3_one_64(mb->get_hint_flags(), hash);