Skip to content

Maneuver planner: Return from a moon in solar orbit gives its message, not an exception - #2820

Merged
sarbian merged 1 commit into
devfrom
lows/planner-moon-return-solar
Nov 29, 2026
Merged

sarbian merged 1 commit into
devfrom
lows/planner-moon-return-solar

Conversation

@sarbian

@sarbian sarbian commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

Part of #2475 (audit epic, MANV): HMANV-7 (Low).

Behaviour change

Return from a moon (and Advanced Transfer) in solar orbit shows "Sun is not orbiting another body you could return to." instead of "An error occurred while creating the node." with an exception.

Fix

The moon-return and Advanced Transfer checks test the body's orbit for null.

Tested

Debug build of MechJeb2.sln on MuMech dev 5d04d30: no new warnings; MechJebLibTest passes. No unit test: the change is in the KSP-side code. Not flown on its own; an earlier in-game regression (a build with all the Low fixes, 13 runs of MechJeb2_UI Spikes 81, 82, 83 and 85, 2026-11-12) found no regression.

…, not an exception

Return from a moon and Advanced Transfer refused an orbit around a body
that orbits nothing by testing referenceBody.referenceBody against null,
but KSP's CelestialBody.referenceBody returns the body itself when it has
no orbit. In solar orbit, Return from a moon went on, read the Sun's null
orbit and showed "An error occurred while creating the node." with an
exception in the log, instead of "Sun is not orbiting another body you
could return to." Both now test the body's orbit.

Audit: HMANV-7
@github-actions

Copy link
Copy Markdown
Contributor

✅ Build Artifact 🚀

MechJeb2-5f3cb85.zip (built from 257fe0a)

@sarbian
sarbian merged commit ce572aa into dev Nov 29, 2026
3 checks passed
@sarbian
sarbian deleted the lows/planner-moon-return-solar branch November 29, 2026 22:16
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