mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
fix(missions): keep the replay countdown real-time when the speed changes
Moving the replay-speed slider during the pre-launch hold or countdown rescaled the time left to liftoff, so 0.25x turned T-8 into T-32 and 4x into T-2. The speed change now skips a replay that has not lifted off; mission time already flown is still preserved as before.
This commit is contained in:
1 parent
a4d3701c3c
commit
a2c813280e
2 files changed
+49
-1
No files matched your search
@@ -281,7 +281,8 @@ export function createReplay({ state: layerState, services, parts, source }) {
|
||||
? layerState._replayPausedAtMs
|
||||
: Date.now();
|
||||
for (const [launchId, startedAt] of layerState._animationStarts) {
|
||||
if (!Number.isFinite(startedAt)) continue;
|
||||
// A countdown runs in real time; rescaling it turned T-8 into T-32 at 0.25x.
|
||||
if (!Number.isFinite(startedAt) || startedAt > now) continue;
|
||||
const elapsedMissionMs = (now - startedAt) * previousSpeed;
|
||||
layerState._animationStarts.set(
|
||||
launchId,
|
||||
|
||||
Reference in new issue
Block a user