ソースを参照

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

Fixes #57506.
Life4gal 3 年 前
コミット
d3612e039a
1 ファイル変更3 行追加0 行削除
  1. 3 0
      scene/resources/resource_format_text.cpp

+ 3 - 0
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);
 			}