From fa685a530f1d7920070327d59416fb7360500225 Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Tue, 16 Jan 2024 16:03:12 -0500 Subject: [PATCH] Fix the longstanding launch to plane bug Should stop going to FINISHED when the vessel comes out of warp. Signed-off-by: Lamont Granquist --- MechJeb2/MechJebModuleAscentBaseAutopilot.cs | 7 +++++-- MechJeb2/MechJebModuleGuidanceController.cs | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/MechJeb2/MechJebModuleAscentBaseAutopilot.cs b/MechJeb2/MechJebModuleAscentBaseAutopilot.cs index 05826c73..8f657af6 100644 --- a/MechJeb2/MechJebModuleAscentBaseAutopilot.cs +++ b/MechJeb2/MechJebModuleAscentBaseAutopilot.cs @@ -213,8 +213,11 @@ private void DriveAscent() { Debug.Log("Awaiting Liftoff"); Status = Localizer.Format("#MechJeb_Ascent_status6"); //"Awaiting liftoff" - // kill the optimizer if it is running. - Core.Guidance.Enabled = false; + + if (TMinus > AscentSettings.WarpCountDown) + Core.Guidance.Enabled = false; + else + Core.Guidance.AssertStart(false); Core.Attitude.SetAxisControl(false, false, false); return; diff --git a/MechJeb2/MechJebModuleGuidanceController.cs b/MechJeb2/MechJebModuleGuidanceController.cs index 8b84329e..8e4b0875 100644 --- a/MechJeb2/MechJebModuleGuidanceController.cs +++ b/MechJeb2/MechJebModuleGuidanceController.cs @@ -75,7 +75,7 @@ protected override void OnModuleDisabled() private bool _allowExecution; // we wait until we get a signal to allow execution to start - public void AssertStart(bool allow_execution = true) => _allowExecution = allow_execution; + public void AssertStart(bool allowExecution = true) => _allowExecution = allowExecution; public override void OnFixedUpdate() {