fix: compute clouds from planned route so destruction cannot leak (review)

This commit is contained in:
2026-06-12 14:44:24 +00:00
parent f563934314
commit ca32407c43
3 changed files with 33 additions and 4 deletions
+15
View File
@@ -73,4 +73,19 @@ describe('clouds', () => {
expect(cloudFor(g, chainPlan(), 99)).toEqual([]);
expect(cloudFor(g, { ...chainPlan(), legs: [] }, 1)).toEqual([]);
});
it('a hidden destroyed outcome does not change the cloud shape', () => {
const g = chainGalaxy();
const intact = chainPlan();
intact.routeLanes = [0, 1, 2];
intact.startSys = 0;
const doomed = chainPlan();
doomed.routeLanes = [0, 1, 2];
doomed.startSys = 0;
doomed.finalOutcome = 'destroyed';
doomed.legs = doomed.legs.slice(0, 1); // itinerary truncated at the hidden destruction
for (const t of [1, 3, 4.5]) {
expect(JSON.stringify(cloudFor(g, doomed, t))).toBe(JSON.stringify(cloudFor(g, intact, t)));
}
});
});