fix(ecs): entity deletion is now type correct

This commit is contained in:
lisk77 2025-11-25 23:28:42 +01:00
parent 607bf94f1e
commit 2a37205c22
4 changed files with 77 additions and 3 deletions

View file

@ -112,9 +112,7 @@ impl Scene {
self.remove_entity_from_archetype(entity_id.index, self.get_component_set(idx));
self.entities[idx] = None;
info!("Deleted entity! ID: {}", entity_id.index);
for (_, value) in self.components.iter_mut() {
value.remove::<u8>(idx);
}
self.components.remove_entity(idx);
if let Some(gen) = self.generations.get_mut(idx) {
*gen = gen.wrapping_add(1);
}