diff options
author | Life4gal <Life4gal@gmail.com> | 2022-08-24 11:43:22 +0800 |
---|---|---|
committer | RĂ©mi Verschelde <rverschelde@gmail.com> | 2023-01-19 12:19:06 +0100 |
commit | d3612e039aca7b08028c35a35e33b66cf2c9ad14 (patch) | |
tree | 76535c3c4504ba5611b462831a14f5c20b8149ef /scene/resources | |
parent | cd0a9ccdfde05963d1b544b773662149f585da0d (diff) |
Fix using Resource objects as keys in the `tres` format
Fixes #57506.
Diffstat (limited to 'scene/resources')
-rw-r--r-- | scene/resources/resource_format_text.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/scene/resources/resource_format_text.cpp b/scene/resources/resource_format_text.cpp index 80b9ff3f38..c85c213c5d 100644 --- a/scene/resources/resource_format_text.cpp +++ b/scene/resources/resource_format_text.cpp @@ -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); } |