mirror of
https://github.com/lisk77/comet.git
synced 2025-12-12 17:18:50 +00:00
fix(ecs): entity deletion is now type correct
This commit is contained in:
parent
607bf94f1e
commit
2a37205c22
4 changed files with 77 additions and 3 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue