fix error

This commit is contained in:
Elliott Pierce 2025-05-31 14:13:26 -04:00
parent 85b0d03dec
commit 4844dda4cc

View File

@ -469,12 +469,14 @@ impl EntityCloner {
{ {
let world = world.as_unsafe_world_cell(); let world = world.as_unsafe_world_cell();
let source_entity = world.get_entity(source).expect("Source entity must exist"); let source_entity = world.get_entity(source).expect("Source entity must exist");
let target_archetype = (!self.filter_required.is_empty()).then(|| { let target_archetype = (!self.filter_required.is_empty())
world .then(|| {
.get_entity(target) world
.expect("Target entity must exist") .get_entity(target)
.archetype() .expect("Target entity must exist")
}); .archetype()
})
.flatten();
#[cfg(feature = "bevy_reflect")] #[cfg(feature = "bevy_reflect")]
// SAFETY: we have unique access to `world`, nothing else accesses the registry at this moment, and we clone // SAFETY: we have unique access to `world`, nothing else accesses the registry at this moment, and we clone