Fix wrong launch location after switching editors#2645
Merged
siimav merged 6 commits intoKSP-RO:masterfrom Sep 30, 2025
Merged
Conversation
Contributor
Author
|
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.





Fix #2572
This was surprisingly complex to deal with. There seems to be some sort of stock bug where if a vessel is loaded automatically in one editor after entering it (which can be done by loading a vehicle, exiting the editor, then re-entering that editor), then the user switches to the other editor,
EditorLogic.fetch.launchSiteName(which actually originates fromEditorDriver.selectedlaunchSiteName) will not update. (although I did a small test in stock and wasn't able to reproduce the bug, so I won't be reporting this to KSPCF)We can check it against
EditorDriver.ValidLaunchSite()to make sure this doesn't occur. If this occurs in the SPH, we don't actually know what launch site to switch it to, but luckily there isn't any way to set a different default launch site for either editor in stock*, so we can just set it to the default which is Runway. This will need to be updated if we add a way to set a different launch site for the SPH outside of the editor (in a similar way we do for LCs)*There's some strange methods regarding this in the stock code.
EditorDriver.setLaunchSite(launchSite)setsEditorLogic.fetch.launchSiteNameandEditorDriver.selectedlaunchSiteNameto launchSite,EditorDriver.saveselectedLaunchSite()setsHighLogic.CurrentGame.defaultVABLaunchSite(or SPH) toEditorDriver.selectedlaunchSiteName, andsetDefaultLaunchSite()setsEditorLogic.fetch.launchSiteNameandEditorDriver.selectedlaunchSiteNameto "LaunchPad" (or "Runway"). How strange.