Check if entity is alive before applying a buff

This commit is contained in:
Enrico Marconi 2021-07-02 14:01:20 +02:00
parent 3ee123b745
commit 7e97b9e495

View File

@ -959,6 +959,7 @@ 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)
{
buffs.insert(new_buff);
}