Browse Source

Kill off entities which have died

master
Graham Northup 6 months ago
parent
commit
93223bcab1
  1. 8
      src/world/mod.rs

8
src/world/mod.rs

@ -170,6 +170,14 @@ impl World {
ents.sort_by_key(|&(_, t)| Reverse(t));
if let Some((i, t)) = ents.pop() {
if {
let e = self.entity(i);
e.is_dead()
} {
self.entities.swap_remove(i);
return None;
}
let mut e = self.entity_mut(i);
let pos = e.pos();
let sr = e.sight();

Loading…
Cancel
Save