Skip to content

fix(driving): correct planned-stop exit warnings and stuck ramps#102

Merged
Orinks merged 2 commits into
Orinks:devfrom
ironcross32:fix/planned-stop-exit-invalidation
Jul 20, 2026
Merged

fix(driving): correct planned-stop exit warnings and stuck ramps#102
Orinks merged 2 commits into
Orinks:devfrom
ironcross32:fix/planned-stop-exit-invalidation

Conversation

@ironcross32

Copy link
Copy Markdown
Contributor

What changed and why

The "You drove past your planned stop" warning was decided purely from the highway odometer in Trip._check_stops, with no awareness of the exit/ramp/signal state. So signaling a planned stop and braking down the exit ramp toward it triggered a false "plan cancelled" the moment the mile marker slipped behind, even though the driver was stopping there.

While investigating, we also discovered there was no invalidation of a stop when the driver signaled and took the ramp but never actually stopped: the ramp waited indefinitely, speed enforcement stayed off, the highway odometer kept advancing, and stopping miles later still opened that stop's menu. That gap predates the planned-stop work — it came in with the original highway-exits feature — and has now been corrected.

The fix:

  • Trip._check_stops suppresses the warning while the planned stop's exit is signaled or on the ramp (published each tick via Trip._exit_in_progress), and otherwise warns once the exit marker is passed — the point past which the ramp is no longer takeable.
  • A signaled-but-too-fast miss folds the cancellation into its single spoken line instead of emitting a second cue.
  • A taken exit that never stops is declared blown once it rolls RAMP_OVERSHOOT_MI (0.5 mi) past the end of the ramp, cancelling the plan and handing normal highway behaviour back (enforcement, lane physics).
  • While on the ramp the truck is off the highway: the mile marker now holds and the ramp consumes the movement (Trip.on_ramp / Trip.last_moved_mi) instead of the highway odometer.

What players will notice

  • Signaling a planned stop and taking its exit no longer announces that you drove past it.
  • If you never signal and drive past the exit, you're told once, when it's genuinely too late to take it.
  • If you take an exit but never stop, the game tells you that you never stopped and returns you to the highway, rather than silently stranding you on an endless ramp.
  • Your route progress no longer ticks up while you brake down an exit ramp; the highway resumes where you left it.

Tests run

  • uv run pytest (full suite) — green.
  • Added test_plan_survives_while_descending_ramp, test_too_fast_miss_cancels_plan_once, test_taken_exit_blown_when_never_stopping, and test_highway_odometer_holds_on_the_ramp in tests/test_stop_detail.py.
  • uv run ruff check src tests — clean.
  • Manual testing by the author checks out.

Accessibility impact

All changes are to spoken cues. The false cancellation is gone; the real cases each speak a single, clear line ("...drove past your planned stop. Plan cancelled." / "...too fast for the ramp and missed... Plan cancelled." / "You never stopped and drove past... Plan cancelled."), with terse-speech variants preserved. No information moved to a visual-only cue.

Changelog

  • Player-facing entries added under ## UnreleasedFixed in CHANGELOG.md.

🤖 Generated with Claude Code

ironcross32 and others added 2 commits July 20, 2026 10:55
The "you drove past your planned stop" warning fired purely on the highway
odometer, with no awareness of the exit/ramp/signal state, so signaling and
braking down the ramp toward the stop triggered a false cancellation.

While investigating we also found there was no invalidation of a stop when
the driver signaled and took the ramp but never actually stopped: the ramp
waited indefinitely, speed enforcement stayed off, the highway odometer kept
advancing, and stopping miles later still opened that stop's menu. That gap
predates the planned-stop work (it came in with the original highway-exits
feature) and is now corrected.

- Trip._check_stops suppresses the warning while the planned stop's exit is
  signaled or on the ramp (published each tick via Trip._exit_in_progress),
  and otherwise warns once the exit marker is passed (no longer takeable).
- A signaled-but-too-fast miss folds the cancellation into its single spoken
  line instead of emitting a second cue.
- A taken exit that never stops is declared blown once it rolls RAMP_OVERSHOOT_MI
  past the ramp end, cancelling the plan and handing the highway back.
- While on the ramp the truck is off the highway: the mile marker holds and the
  ramp consumes the movement (Trip.on_ramp / last_moved_mi) instead of the
  highway odometer.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Orinks
Orinks enabled auto-merge July 20, 2026 20:16
@Orinks
Orinks merged commit 43a8752 into Orinks:dev Jul 20, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants