mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
fix agent aggression when not recieving damage from attack
This commit is contained in:
@ -198,6 +198,7 @@ pub fn get_attacker(entity: EcsEntity, read_data: &ReadData) -> Option<EcsEntity
|
|||||||
read_data
|
read_data
|
||||||
.healths
|
.healths
|
||||||
.get(entity)
|
.get(entity)
|
||||||
|
.filter(|health| health.last_change.amount < 0.0)
|
||||||
.and_then(|health| health.last_change.damage_by())
|
.and_then(|health| health.last_change.damage_by())
|
||||||
.and_then(|damage_contributor| get_entity_by_id(damage_contributor.uid().0, read_data))
|
.and_then(|damage_contributor| get_entity_by_id(damage_contributor.uid().0, read_data))
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user