public void SelectAutopilotMode(VesselAutopilot.AutopilotMode autopilotMode)
{
if (currentVessel.Autopilot.Mode != autopilotMode)
{
if (!currentVessel.Autopilot.CanSetMode(autopilotMode))
{
// throw an exception if the mode is not available
throw new KOSSituationallyInvalidException(
string.Format("Cannot set autopilot value, pilot/probe does not support {0}, or there is no node/target", autopilotMode));
}
currentVessel.Autopilot.SetMode(autopilotMode);
//currentVessel.Autopilot.Enable();
// change the autopilot indicator
((kOSProcessor)Shared.Processor).SetAutopilotMode((int)autopilotMode);
if (RemoteTechHook.IsAvailable(currentVessel.id))
{
//Debug.Log(string.Format("kOS: Adding RemoteTechPilot: autopilot For : " + currentVessel.id));
// TODO: figure out how to make RemoteTech allow the built in autopilot control. This may require modification to RemoteTech itself.
}
}
}