Merge branch 'UMR1352/fix#1223' into 'master'

Fix issue #1223: Check if entity is alive before applying a buff

Closes #1223

See merge request veloren/veloren!2541
This commit is contained in:
Samuel Keiffer 2021-07-05 16:55:17 +00:00
commit a8447fd62d

View File

@ -959,6 +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
.read_component::<Health>()
.get(entity)
.map_or(true, |h| !h.is_dead)
{
buffs.insert(new_buff);
}