Change behaviour of pausing on landing - it should pause and not change speed. While you start flight it shoud auto unpause and pause again when plane lands.
#41
What changed: Replaced the old "auto-slow to 1×" behavior (v0.19.0 / ISS-011) with a real pause that leaves the time scale untouched, plus an auto-resume when you start a flight.
lib/sim/engine.ts — when the last plane in flight lands, the sim now sets paused = true instead of resetting timeScale to 1×. The stored speed is preserved; the trigger condition (last plane in flight) and no-auto-restore semantics are unchanged.
lib/game/actions.ts — flyPlane() now writes sim_state.paused = false, so dispatching a flight auto-resumes a paused sim (atomic under the sim lock).
Net effect: dispatch resumes → planes fly → last landing pauses (speed kept) → next dispatch resumes again.
Tests: rewrote the auto-slow unit block for pause semantics (last landing → paused=true, scale unchanged; a landing with another plane still flying → no pause); added a flyPlane() test that dispatch on a paused sim clears paused and leaves the scale untouched. E2E: renamed auto-slow.spec.ts → pause-on-landing.spec.ts asserting simState.paused === trueandtimeScale === 1000 after landing, plus auto-unpause on /fly. The per-spec fast-forward helpers now also clear pause after landings.
Fixed in **v0.24.0**.
**What changed:** Replaced the old "auto-slow to 1×" behavior (v0.19.0 / ISS-011) with a real **pause that leaves the time scale untouched**, plus an **auto-resume when you start a flight**.
- `lib/sim/engine.ts` — when the last plane in flight lands, the sim now sets `paused = true` instead of resetting `timeScale` to 1×. The stored speed is preserved; the trigger condition (last plane in flight) and no-auto-restore semantics are unchanged.
- `lib/game/actions.ts` — `flyPlane()` now writes `sim_state.paused = false`, so dispatching a flight auto-resumes a paused sim (atomic under the sim lock).
Net effect: **dispatch resumes → planes fly → last landing pauses (speed kept) → next dispatch resumes again.**
**Tests:** rewrote the auto-slow unit block for pause semantics (last landing → `paused=true`, scale unchanged; a landing with another plane still flying → no pause); added a `flyPlane()` test that dispatch on a paused sim clears `paused` and leaves the scale untouched. E2E: renamed `auto-slow.spec.ts` → `pause-on-landing.spec.ts` asserting `simState.paused === true` **and** `timeScale === 1000` after landing, plus auto-unpause on `/fly`. The per-spec fast-forward helpers now also clear pause after landings.
- PR: #49
- Merge commit: `e109e003c024179a277f6799133a90b96d05c6d6`
- Deployed: https://flight.dev.kkhost.pl (verified `/api/version` = 0.24.0, root HTTP 200)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Fixed in v0.24.0.
What changed: Replaced the old "auto-slow to 1×" behavior (v0.19.0 / ISS-011) with a real pause that leaves the time scale untouched, plus an auto-resume when you start a flight.
lib/sim/engine.ts— when the last plane in flight lands, the sim now setspaused = trueinstead of resettingtimeScaleto 1×. The stored speed is preserved; the trigger condition (last plane in flight) and no-auto-restore semantics are unchanged.lib/game/actions.ts—flyPlane()now writessim_state.paused = false, so dispatching a flight auto-resumes a paused sim (atomic under the sim lock).Net effect: dispatch resumes → planes fly → last landing pauses (speed kept) → next dispatch resumes again.
Tests: rewrote the auto-slow unit block for pause semantics (last landing →
paused=true, scale unchanged; a landing with another plane still flying → no pause); added aflyPlane()test that dispatch on a paused sim clearspausedand leaves the scale untouched. E2E: renamedauto-slow.spec.ts→pause-on-landing.spec.tsassertingsimState.paused === trueandtimeScale === 1000after landing, plus auto-unpause on/fly. The per-spec fast-forward helpers now also clear pause after landings.e109e003c024179a277f6799133a90b96d05c6d6/api/version= 0.24.0, root HTTP 200)