Fix using Resource objects as keys in the `tres` format

Fixes #57506.
This commit is contained in:
Life4gal 2022-08-24 11:43:22 +08:00 committed by Rémi Verschelde
parent cd0a9ccdfd
commit d3612e039a
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 3 additions and 0 deletions

View File

@ -1846,6 +1846,9 @@ void ResourceFormatSaverTextInstance::_find_resources(const Variant &p_variant,
List<Variant> keys;
d.get_key_list(&keys);
for (const Variant &E : keys) {
// Of course keys should also be cached, after all we can't prevent users from using resources as keys, right?
// See also ResourceFormatSaverBinaryInstance::_find_resources (when p_variant is of type Variant::DICTIONARY)
_find_resources(E);
Variant v = d[E];
_find_resources(v);
}