mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fix warning agents not switching aggro on attack
This commit is contained in:
parent
4f32bbba2b
commit
f9580a576c
@ -504,10 +504,13 @@ impl<'a> System<'a> for Sys {
|
|||||||
// specific proportional threshold.
|
// specific proportional threshold.
|
||||||
const FUZZY_DIST_COMPARISON: f32 = 0.8;
|
const FUZZY_DIST_COMPARISON: f32 = 0.8;
|
||||||
// Only switch to new target if it is closer
|
// Only switch to new target if it is closer
|
||||||
// than the old target
|
// than the old target, or if the old target
|
||||||
tgt_pos.0.distance(pos.0)
|
// had not triggered aggro (the new target
|
||||||
< old_tgt_pos.0.distance(pos.0)
|
// has because damage always triggers it)
|
||||||
* FUZZY_DIST_COMPARISON
|
!old_tgt.aggro_on
|
||||||
|
|| tgt_pos.0.distance(pos.0)
|
||||||
|
< old_tgt_pos.0.distance(pos.0)
|
||||||
|
* FUZZY_DIST_COMPARISON
|
||||||
} else {
|
} else {
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user