fixed node handle mapping for hash maps

This commit is contained in:
Dmitry Stepanov
2024-11-08 15:05:17 +03:00
parent 3521280d76
commit 68ce2e037a
+37
View File
@@ -254,6 +254,21 @@ where
return;
}
entity.as_hash_map_mut(&mut |hash_map| {
if let Some(hash_map) = hash_map {
for i in 0..hash_map.reflect_len() {
if let Some(item) = hash_map.reflect_get_nth_value_mut(i) {
self.remap_handles_internal(item, node_name, ignored_types);
}
}
mapped = true;
}
});
if mapped {
return;
}
// Continue remapping recursively for every compound field.
entity.fields_mut(&mut |fields| {
for field in fields {
@@ -366,6 +381,28 @@ where
return;
}
entity.as_hash_map_mut(&mut |result| {
if let Some(hash_map) = result {
for i in 0..hash_map.reflect_len() {
if let Some(item) = hash_map.reflect_get_nth_value_mut(i) {
self.remap_inheritable_handles_internal(
item,
node_name,
// Propagate mapping flag - it means that we're inside inheritable variable. In this
// case we will map handles.
do_map,
ignored_types,
);
}
}
mapped = true;
}
});
if mapped {
return;
}
// Continue remapping recursively for every compound field.
entity.fields_mut(&mut |fields| {
for field in fields {