Release interceptor engine source at burnout
Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
@@ -113,6 +113,8 @@ pub struct Out {
|
||||
/// The engines sounding this tick (persistent sources, `crate::engines`), and whether the
|
||||
/// picture cut (a replay seek or a new shot): every engine then starts afresh.
|
||||
pub engines: Vec<EngineDecl>,
|
||||
/// Sources explicitly stopped this tick (for example, motor burnout).
|
||||
pub engine_stops: Vec<u32>,
|
||||
pub engine_cut: bool,
|
||||
pub commands: Vec<String>,
|
||||
/// Camera jolt (strength, seconds), the strongest this tick.
|
||||
@@ -2983,6 +2985,7 @@ impl Sim {
|
||||
let spec = m.kind.spec();
|
||||
let target = self.drones.iter().find(|d| d.id == m.target && d.alive());
|
||||
let lit = m.engine_lit();
|
||||
if !lit { out.engine_stops.push(0x4000_0000 | m.id); }
|
||||
let coast = m.age > spec.cold + m.kind.burn_ticks();
|
||||
if m.age == spec.cold + m.kind.burn_ticks() + 1 {
|
||||
burnouts.push((m.pos, m.id, m.kind));
|
||||
|
||||
@@ -1877,6 +1877,7 @@ fn motor_burnout_reduces_speed_and_stops_powered_effects() {
|
||||
assert!(powered <= last && sim.missiles[0].vel.length() < last);
|
||||
assert!(!sim.missiles[0].engine_lit());
|
||||
assert!(!out.engines.iter().any(|e| e.key == 0x4000_0000 | id));
|
||||
assert!(out.engine_stops.contains(&(0x4000_0000 | id)));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user