Match impact speed to swept segment

Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
2026-11-02 23:56:42 +03:00
parent e3ca3fbd8c
commit e38ca0d9ab
+2 -1
View File
@@ -3099,7 +3099,8 @@ impl Sim {
let kill = self.rng.chance(spec.pk * fit * ratio);
// The same swept closest approach determines the physical impact, not the
// target's end-of-tick location. Velocities are per simulation tick.
impacts.insert(m.id, (t.pos - t.vel + t.vel * k, (m.vel - t.vel).length()));
let missile_step = if waiting.is_some() { end - before } else { m.pos - before };
impacts.insert(m.id, (t.pos - t.vel + t.vel * k, (missile_step - t.vel).length()));
missed += u32::from(!kill);
done.push((m.id, Some(t.id), kill, m.sam));
continue;