Skip to content

Commit

Permalink
Fix harmless errors on launching vessels.
Browse files Browse the repository at this point in the history
These were caused by loaded scene flag getting changed to Flight at the wrong time during a frame.
  • Loading branch information
siimav committed Aug 27, 2024
1 parent 68a60fd commit 6f14f3f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Source/RP0/SpaceCenter/Projects/VesselProject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,10 @@ public void Launch(bool fillFuel = false)

KCTUtilities.CleanupDebris(launchSiteName);
SpaceCenterManagement.Instance.AirlaunchParams.KSPVesselId = Guid.Empty;
FlightDriver.StartWithNewLaunch(tempFile, flag, launchSiteName, new VesselCrewManifest());
SpaceCenterManagement.Instance.StartCoroutine(CallbackUtil.DelayedCallback(1, delegate
{
FlightDriver.StartWithNewLaunch(tempFile, flag, launchSiteName, new VesselCrewManifest());
}));
}

public bool ResourcesOK(LCData stats, List<string> failedReasons = null)
Expand Down
5 changes: 4 additions & 1 deletion Source/RP0/UI/KCT/GUI_Simulation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,10 @@ private static void StartSim(SimulationParams simParams)
{
launchSiteName = SpaceCenterManagement.Instance.ActiveSC.ActiveLC.ActiveLPInstance.launchSiteName;
}
FlightDriver.StartWithNewLaunch(tempFile, EditorLogic.FlagURL, launchSiteName, manifest);
SpaceCenterManagement.Instance.StartCoroutine(CallbackUtil.DelayedCallback(1, delegate
{
FlightDriver.StartWithNewLaunch(tempFile, EditorLogic.FlagURL, launchSiteName, manifest);
}));
}
}
}

0 comments on commit 6f14f3f

Please sign in to comment.