ensuring we remove entities from the SpatialMap when they die
This commit is contained in:
parent
2ba7cfad8d
commit
012d61603a
3 changed files with 36 additions and 5 deletions
|
|
@ -56,6 +56,10 @@ impl<'a> System<'a> for DamageSystem {
|
|||
if let Some(xp_value) = gives_xp {
|
||||
xp_gain += xp_value.amount;
|
||||
}
|
||||
if let Some(pos) = pos {
|
||||
let idx = map.xy_idx(pos.x, pos.y);
|
||||
crate::spatial::remove_entity(entity, idx);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue