mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-04 10:24:02 +00:00
Merge pull request #1443 from Rohilalala/fix/e-replay-countdown-ten
fix(missions): run the full T-10 replay countdown after the tile hold
This commit is contained in:
3 files changed
+18
-1
No files matched your search
@@ -0,0 +1,3 @@
|
|||||||
|
- Run Space Missions' Replay Ascent countdown from T−10 after the five-second
|
||||||
|
tile hold; the hold ran 10 s and the countdown started at T−05 (Aditya,
|
||||||
|
@Rohilalala, #1443).
|
||||||
@@ -445,6 +445,18 @@ test('holds replay at the pad for a real-time countdown independent of replay sp
|
|||||||
assert.ok(liftoff.phaseProgress > 0);
|
assert.ok(liftoff.phaseProgress > 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('runs the five-second tile hold before a full T-10 countdown', () => {
|
||||||
|
const launch = { launchTime: '2026-07-20T10:00:00Z', timeline: [] };
|
||||||
|
// REPLAY ASCENT puts liftoff 5 s (tile hold) + 10 s (countdown) ahead.
|
||||||
|
const hold = replayState(launch, 115000, 12, 28, 5400, 1, 104500, 5);
|
||||||
|
assert.equal(hold.preCountdownActive, true);
|
||||||
|
assert.equal(hold.countdownActive, false);
|
||||||
|
const countdown = replayState(launch, 115000, 12, 28, 5400, 1, 105000, 5);
|
||||||
|
assert.equal(countdown.preCountdownActive, false);
|
||||||
|
assert.equal(countdown.countdownActive, true);
|
||||||
|
assert.equal(countdown.countdownSeconds, 10);
|
||||||
|
});
|
||||||
|
|
||||||
test('hands replay directly from ascent into orbit', () => {
|
test('hands replay directly from ascent into orbit', () => {
|
||||||
const launch = { launchTime: '2026-07-20T10:00:00Z', timeline: [] };
|
const launch = { launchTime: '2026-07-20T10:00:00Z', timeline: [] };
|
||||||
const orbit = replayState(launch, 0, 12, 28, 5400, 1, 16_000);
|
const orbit = replayState(launch, 0, 12, 28, 5400, 1, 16_000);
|
||||||
|
|||||||
@@ -139,8 +139,10 @@ export function createReplay({ state: layerState, services, parts, source }) {
|
|||||||
0,
|
0,
|
||||||
Number(preCountdownDurationSec) || 0,
|
Number(preCountdownDurationSec) || 0,
|
||||||
);
|
);
|
||||||
|
// The hold precedes the whole countdown; ending it at -hold cut T-10 to T-5.
|
||||||
const preCountdownActive =
|
const preCountdownActive =
|
||||||
preCountdownDuration > 0 && realSecondsSinceStart < -preCountdownDuration;
|
preCountdownDuration > 0 &&
|
||||||
|
realSecondsSinceStart < -REPLAY_COUNTDOWN_DURATION_SEC;
|
||||||
const countdownActive = realSecondsSinceStart < 0 && !preCountdownActive;
|
const countdownActive = realSecondsSinceStart < 0 && !preCountdownActive;
|
||||||
const countdownSeconds = countdownActive
|
const countdownSeconds = countdownActive
|
||||||
? Math.ceil(-realSecondsSinceStart)
|
? Math.ceil(-realSecondsSinceStart)
|
||||||
|
|||||||
Reference in new issue
Block a user