Repository navigation
Conversation
A solve started before a jettison cut could land while JETTISON waited for KSP's staging cooldown. When its burn ended later than now, JettisonIndex went back to -1, the state returned to BURNING and the throttle came back up on the cut engines (a RealFuels engine with no relights is then lost). JETTISON now latches the flight plan index of the burn it was entered for until its engines are gone. Test: StaleSolutionInJettisonDoesNotRelightTheCutBooster, failing on dev ef54081.
Contributor
✅ Build Artifact 🚀MechJeb2-d852294.zip (built from 1a5ed0f) |
lamont-granquist
added a commit
that referenced
this pull request
Nov 21, 2026
A Solution solved before a jettison cut could land while JETTISON waited for KSP's staging cooldown. If it ended the burn later than the one being cut, guidance went back to BURNING and throttled the cut engines up again (#2782). 8b173b5a kept the PSG simulation from handing such a Solution over, but the state machine still took one. AscentStateMachine.TakesSolution is now the rule: PRELAUNCH, BURNING and COASTING. SetSolution refuses a Solution in any other state, which extends its old refusal in terminal guidance and once finished. The vertical ascent and the pitch program fly the pad Solution to guidance, a jettison drops the burn its Solution cut, and terminal guidance flies to the end of the Solution it started with. The PSG autopilot passes TakesSolution through, and its SetSolution returns whether the Solution was taken. The simulation drops its own copy of the rule: HandleDoneTask throws away a Solution SetSolution refused, before any of its bookkeeping, and solves start only while the autopilot TakesSolution. The autopilot's IsTerminal, which nothing used any more, is gone. JettisonRefusesALateSolution is the scenario from #2782 (it lit the cut booster twice before this). ClimbRefusesALateSolution replaces PitchProgramMeetsTheGuidanceOfANewSolutionAtOnce, which gave an ascent engaged in flight its first Solution in the pitch program. Ascents engaged in flight aren't supported, and the pitch program now refuses that Solution: the new test checks the refusal in the vertical ascent and the pitch program of a pad launch, which keeps its pad Solution.
Collaborator
|
Fixed this instead by avoiding taking solutions in JETTISON: a348480 |
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.
A Solution solved before a jettison cut could land while JETTISON waited for KSP's staging cooldown. If its burn ended later, the state went back to BURNING and the cut engines were throttled up again. JETTISON now latches the burn it was entered for until its engines are gone.
Adds
StaleSolutionInJettisonDoesNotRelightTheCutBooster(failed on dev ef54081).Not tested: compiled only (MechJebLibTest Release, or MechJeb2.sln Debug). No unit test or flight was run on this branch.
From the review of #2776 and #2777: #2776 (comment)