Repository navigation
Maneuver planner: Return from a moon in solar orbit gives its message, not an exception - #2820
Merged
Merged
Conversation
…, 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
Contributor
✅ Build Artifact 🚀MechJeb2-5f3cb85.zip (built from 257fe0a) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.