Fall back to an uncrewed control source on vessel separation - #424
Open
djungelorm wants to merge 1 commit into
Open
Fall back to an uncrewed control source on vessel separation#424djungelorm wants to merge 1 commit into
djungelorm wants to merge 1 commit into
Conversation
Vessel.FallBackReferenceTransform() picks the control point for a vessel created by decoupling, undocking or a part being destroyed, but it asks ShipConstruction.findFirstCrewablePart() for it, which only accepts a part with crew capacity, crew actually aboard and control source. A probe core or an empty command pod fails that test, so the new vessel gets no control point at all and ends up oriented by its root part, breaking the navball, SAS and autopilots until the player sets one manually. Override the method so that when findFirstCrewablePart() finds nothing, it falls back to the first part that is a control source, searched in the same root-first order. A crewed part still wins, and findFirstCrewablePart() is left alone for its other callers.
Phantomical
approved these changes
Aug 13, 2026
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.
Vessel.FallBackReferenceTransform()picks the control point for a vessel created by decoupling, undocking or a part being destroyed, but it asksShipConstruction.findFirstCrewablePart()for it, which only accepts a part with crew capacity, crew actually aboard and control source. A probe core or an empty command pod fails that test, so the new vessel gets no control point at all and ends up oriented by its root part, breaking the navball, SAS and autopilots until the player sets one manually.Override the method so that when
findFirstCrewablePart()finds nothing, it falls back to the first part that is a control source, searched in the same root-first order. A crewed part still wins, andfindFirstCrewablePart()is left alone for its other callers.This was originally found via the kRPC mod, where programmatically decoupling a vessel would leave the newly created vessel in an invalid control state, and its controlling part would need to be set to the probe core on the new vessel.