Keep a landed aircraft on the ground, not at its approach height

A grounded row with no altitude fell back to the aircraft's sticky
altitude, which straight after a landing is still the approach height.
Military contacts then hung there for as long as they stayed on the
ground (the grounded floor only ever raises a height); civil contacts
held it until the ground cell under them warmed, which for a contact far
from the viewer is never. The 3D model is ground-snapped on its own, so
the plane dropped when the model took over.

A grounded contact with no altitude now uses only an altitude it gave
on the ground, else the ground fallback. Labels, the tracked readout
and the follow distance read "On the ground" / no flight level instead
of the approach altitude.
This commit is contained in:
Sameh Khamis committed 2026-11-19 20:22:33 -08:00
1 parent 20620e89bf
commit 9b10489454
8 files changed
+145 -26

No files matched your search

+46
View File
@@ -65,6 +65,52 @@ test('military ground records leave model-owned placement alone and warm the sam
assert.deepEqual(unowned.floorWarmPoints, owned.floorWarmPoints);
});
test('a military contact that lands with no altitude sits on the ground, not at its last airborne height', () => {
for (const [modelOwnsVisual, expected] of [
[false, 201.5],
[true, 0],
]) {
const records = store();
records.receive(
observation({ baroAltitudeM: 1539 }),
context({ modelOwnsVisual }),
);
// Every grounded report, not just the first after the landing.
for (let poll = 0; poll < 3; poll += 1) {
const landed = records.receive(
observation({ onGround: true, baroAltitudeM: null, speedMps: 4.6 }),
context({ modelOwnsVisual }),
);
assert.equal(landed.meta.renderAltitudeM, expected);
// The aviation readout keeps the last reported altitude, as before.
assert.equal(landed.meta.altitudeFt, 1539 / 0.3048);
}
}
});
test('a grounded military contact holds a ground altitude it reported earlier', () => {
const records = store();
records.receive(
observation({ onGround: true, baroAltitudeM: 320 }),
context({ modelOwnsVisual: true }),
);
for (let poll = 0; poll < 2; poll += 1) {
const next = records.receive(
observation({ onGround: true, baroAltitudeM: null }),
context({ modelOwnsVisual: true }),
);
assert.equal(next.meta.renderAltitudeM, 320);
}
// Airborne again: that ground altitude is forgotten, so the next landing
// without an altitude starts from the ground, not from it.
records.receive(observation({ baroAltitudeM: 900 }), context());
const relanded = records.receive(
observation({ onGround: true, baroAltitudeM: null }),
context({ modelOwnsVisual: true }),
);
assert.equal(relanded.meta.renderAltitudeM, 0);
});
test('military records keep bounded partial retention and release metadata only after removal admission', () => {
const first = store();
const second = store();