Now using the new CurrentCommand extension method to properly handle all use cases.
Now using the new CurrentCommand extension method to properly handle all use cases.

--- a/ARFlightController.cs
+++ b/ARFlightController.cs
@@ -166,15 +166,25 @@
 				HighLogic.LoadedSceneIsFlight &&
 				requireConnectionForControl &&
 				this.vessel != null &&
-				this.vessel.vesselType != VesselType.EVA &&
-				!this.vessel.hasCrewCommand() &&
-				!this.vessel.HasConnectedRelay())
-			{
-				// ...and if the controls are not currently locked...
-				if (currentControlLock == ControlTypes.None)
-				{
-					// ...lock the controls.
-					InputLockManager.SetControlLock(this.lockSet, this.lockID);
+				this.vessel.vesselType != VesselType.EVA
+			)
+			{
+				VesselCommand availableCommand = this.vessel.CurrentCommand();
+
+				Tools.PostDebugMessage(this, "availableCommand: {0}", (int)availableCommand);
+
+				if (
+					!(
+						(availableCommand & VesselCommand.Crew) == VesselCommand.Crew ||
+						(availableCommand & VesselCommand.Probe) == VesselCommand.Probe && vessel.HasConnectedRelay()
+					)
+				)
+				{// ...and if the controls are not currently locked...
+					if (currentControlLock == ControlTypes.None)
+					{
+						// ...lock the controls.
+						InputLockManager.SetControlLock(this.lockSet, this.lockID);
+					}
 				}
 			}
 			// ...otherwise, if the controls are locked...
@@ -276,7 +286,8 @@
 
 			if (this.appLauncherButton != null)
 			{
-				ApplicationLauncher.Instance.RemoveApplication(this.appLauncherButton);
+				ApplicationLauncher.Instance.RemoveModApplication(this.appLauncherButton);
+				this.appLauncherButton = null;
 			}
 
 			GameEvents.onGameSceneLoadRequested.Remove(this.onSceneChangeRequested);
@@ -289,11 +300,8 @@
 		#region Event Handlers
 		protected void onSceneChangeRequested(GameScenes scene)
 		{
-			if (scene != GameScenes.FLIGHT)
-			{
-				print("ARFlightController: Requesting Destruction.");
-				MonoBehaviour.Destroy(this);
-			}
+			print("ARFlightController: Requesting Destruction.");
+			MonoBehaviour.Destroy(this);
 		}
 
 		protected void onVesselChange(Vessel vessel)

--- a/Properties/AssemblyInfo.cs
+++ b/Properties/AssemblyInfo.cs
@@ -39,7 +39,7 @@
 // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
 // The form "{Major}.{Minor}.*" will automatically update the build and revision,
 // and "{Major}.{Minor}.{Build}.*" will update just the revision.
-[assembly: AssemblyVersion("1.4.*")]
+[assembly: AssemblyVersion("1.4.2.*")]
 // The following attributes are used to specify the signing key for the assembly,
 // if desired. See the Mono documentation for more information about signing.
 //[assembly: AssemblyDelaySign(false)]