Observe emitting radars and expose emission control
Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
@@ -466,11 +466,20 @@ impl Sim {
|
||||
}
|
||||
// The network: every unit gets the tracks the radars within data-link range measured themselves,
|
||||
// with the time they were measured: a relayed track is never fresher than its measurement.
|
||||
// Fictional passive observation: hostile aircraft within 1600 blocks fix an emitting radar
|
||||
// every 20 ticks. Silence leaves the previous report to age normally.
|
||||
if now % 20 == 0 {
|
||||
for s in self.sams.iter().filter(|s| s.radar_up()) {
|
||||
if self.drones.iter().any(|d| d.alive() && d.pos.distance(s.pos) <= 1600.0) {
|
||||
self.intel.revealed.push((s.id, s.pos, now));
|
||||
}
|
||||
}
|
||||
}
|
||||
let shared: Vec<(u32, DVec3, f64, Vec<Track>)> = self
|
||||
.sams
|
||||
.iter()
|
||||
.filter(|s| s.radar_up() && s.link_range() > 0.0)
|
||||
.map(|s| (s.id, s.pos, s.link_range(), s.tracks.iter().filter(|t| t.own_tick == t.tick).copied().collect::<Vec<_>>()))
|
||||
.map(|s| (s.id, s.pos, s.link_range(), s.tracks.iter().filter(|t| t.own_tick > 0 && t.own_tick == t.tick).copied().collect::<Vec<_>>()))
|
||||
.filter(|s| !s.3.is_empty())
|
||||
.collect();
|
||||
for sam in &mut self.sams {
|
||||
|
||||
Reference in New Issue
Block a user