voice no longer hard-coded, bogeydope ordering fix, tripwire ignoring on-ground units

This commit is contained in:
AviiNL
2023-12-27 15:51:15 +01:00
parent e6596f27ad
commit a11402e763
7 changed files with 18 additions and 25 deletions

View File

@@ -47,11 +47,11 @@ pub fn bogey_dope(
return;
};
let mut distance: f64 = 0.0;
let mut distance: f64 = f64::MAX;
let mut n = (None, None);
for (n_pos, n_heading) in npc.iter() {
let d = p_pos.distance_to_nmi(n_pos);
if distance < d {
if d < distance {
distance = d;
n = (Some(n_pos), Some(n_heading));
}