-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make sure that LaunchedVessel information is available even when buil…
…d times are disabled
- Loading branch information
Showing
3 changed files
with
25 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using HarmonyLib; | ||
|
||
namespace RP0.Harmony | ||
{ | ||
internal class PatchEditorLogic | ||
{ | ||
[HarmonyPatch(typeof(EditorLogic))] | ||
internal class PatchGoForLaunch | ||
{ | ||
[HarmonyPrefix] | ||
[HarmonyPatch("goForLaunch")] | ||
internal static void Prefix_goForLaunch() | ||
{ | ||
if (PresetManager.Instance.ActivePreset?.GeneralSettings?.Enabled != true) return; | ||
|
||
KerbalConstructionTimeData.Instance.LaunchedVessel = new VesselProject(EditorLogic.fetch.ship, EditorLogic.fetch.launchSiteName, EditorLogic.FlagURL, false); | ||
KerbalConstructionTimeData.Instance.LaunchedVessel.LCID = KerbalConstructionTimeData.Instance.ActiveSC.ActiveLC.ID; | ||
} | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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