Actually check if entity is alive

This commit is contained in:
Enrico Marconi 2021-07-02 17:58:08 +02:00
parent 7e97b9e495
commit 8106ac492a

View File

@ -959,7 +959,10 @@ pub fn handle_buff(server: &mut Server, entity: EcsEntity, buff_change: buff::Bu
if !bodies
.get(entity)
.map_or(false, |body| body.immune_to(new_buff.kind))
&& ecs.is_alive(entity)
&& ecs
.read_component::<Health>()
.get(entity)
.map_or(true, |h| !h.is_dead)
{
buffs.insert(new_buff);
}