ensuring we remove entities from the SpatialMap when they die

This commit is contained in:
Llywelwyn 2023-08-16 01:29:00 +01:00
parent 2ba7cfad8d
commit 012d61603a
3 changed files with 36 additions and 5 deletions

View file

@ -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);
}
}
}
}