Skip to content

Small bug fixes and emergency recovery from sun.#4

Open
Wauxadd wants to merge 4 commits intoStumpii:mainfrom
Wauxadd:main
Open

Small bug fixes and emergency recovery from sun.#4
Wauxadd wants to merge 4 commits intoStumpii:mainfrom
Wauxadd:main

Conversation

@Wauxadd
Copy link

@Wauxadd Wauxadd commented Feb 10, 2026

I have made some small bug fixes and also added emergency recovery if rammed to the sun.

…ization editor, GUI, waypoint editor, key bindings, autopilot logic, and OCR functionality.
New method _is_in_supercruise_or_space() — Checks ship state using both journal and status.json flags to avoid race conditions where the journal reader is slower than status flags.
Refactored status checks — Replaced inline jn.ship_state()['status'] == 'in_supercruise' or ... == 'in_space' checks in nav_align(), mnvr_to_target(), and jump() with the new helper.
mnvr_to_target() retry loop — Instead of immediately throwing, waits up to 5 seconds (10 × 0.5s) for the ship to reach supercruise/space before raising an exception.
New method recover_from_sc_drop(scr_reg) — Handles unexpected supercruise drops near a star: pitches away, boosts clear, waits for FSD cooldown, re-enters supercruise, and escapes the star.
fsd_assist() — sun-ahead check on manual restart — If already in supercruise when FSD assist starts and the sun is dead ahead, performs refuel + position sequence.
fsd_assist() — SC drop recovery integration — Detects sc_exit_body_type == 'Star' at three points in the jump loop (after jump, after refuel, after position) and triggers recover_from_sc_drop().
Reset nav correction offsets — Clears _nav_cor_x / _nav_cor_y before each alignment pass.
EDJournal.py (staged)
New ship state field sc_exit_body_type — Initialized to '', cleared on SupercruiseEntry/FSDJump, and set from SupercruiseExit event's BodyType field. Used to detect drops near stars.
StatusParser.py (staged)
Reduced log noise — Only logs retry messages from attempt 2+; success message only from attempt 3+.
Capped retry backoff — backoff is now capped at 1.0s via min(backoff * 2, 1.0).
Added else clause — Handles the case where the for loop exhausts all attempts without a successful read.
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.

1 participant