voice no longer hard-coded, bogeydope ordering fix, tripwire ignoring on-ground units
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ impl Config {
|
||||
ChannelConfig {
|
||||
frequency: 251000000,
|
||||
modulation: Modulation::Am,
|
||||
voice: Voice::David,
|
||||
voice: Voice::new("David"),
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ fn give_awacs_radio(
|
||||
commands.entity(ent).insert(Radio::new(
|
||||
channel.frequency,
|
||||
channel.modulation,
|
||||
channel.voice,
|
||||
channel.voice.clone(),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,6 +45,10 @@ fn tripwire(
|
||||
}
|
||||
|
||||
for (n_id, n_position, n_heading) in npc.iter() {
|
||||
if n_position.angels() == 0 {
|
||||
// ignore on-ground units
|
||||
continue;
|
||||
}
|
||||
let distance = n_position.distance_to_nmi(p_position);
|
||||
if distance <= p_tripwire.range && !p_tripwire.reported.contains(n_id) {
|
||||
p_tripwire.reported.push(*n_id);
|
||||
|
||||
Reference in New Issue
Block a user