small tweaks, cleanup, and cranks offset

This commit is contained in:
Llywelwyn 2023-08-17 15:11:24 +01:00
parent 6eab48e616
commit 72f8dbbdf4
6 changed files with 22 additions and 8 deletions

View file

@ -27,6 +27,7 @@ pub fn inflict_damage(ecs: &mut World, damage: &EffectSpawner, target: Entity) {
Targets::Entity { target },
);
if target_pool.hit_points.current < 1 {
super::DEAD_ENTITIES.lock().unwrap().push_back(target);
add_effect(damage.source, EffectType::EntityDeath, Targets::Entity { target });
}
}
@ -106,7 +107,6 @@ pub fn bloodstain(ecs: &mut World, target: usize) {
}
pub fn entity_death(ecs: &mut World, effect: &EffectSpawner, target: Entity) {
super::DEAD_ENTITIES.lock().unwrap().push_back(target);
let mut xp_gain = 0;
let mut pools = ecs.write_storage::<Pools>();
let attributes = ecs.read_storage::<Attributes>();