ARFlightController: Added pretty-lines toggle functionality to the map mode buttons.
ARFlightController: Added pretty-lines toggle functionality to the map mode buttons.

--- a/ARConfiguration.cs
+++ b/ARConfiguration.cs
@@ -23,10 +23,6 @@
 		private const string FIXED_POWER_KEY = "fixedPowerCost";
 		private const string PRETTY_LINES_KEY = "drawPrettyLines";
 		private const string UPDATE_DELAY_KEY = "updateDelay";
-		private const string USE_ADDITIVE_KEY = "useAdditiveRanges";
-
-		private const string TRACKING_STATION_RANGES_KEY = "TRACKING_STATION_RANGES";
-		private const string RANGE_KEY = "range";
 
 		/// <summary>
 		/// Indicates whether connections require line of sight.
@@ -74,39 +70,10 @@
 			set;
 		}
 
-		/// <summary>
-		/// Gets the update delay.
-		/// </summary>
 		public static long UpdateDelay
 		{
 			get;
 			private set;
-		}
-
-		public static bool UseAdditiveRanges
-		{
-			get;
-			private set;
-		}
-
-		/// <summary>
-		/// Gets Kerbin's relay range based on the current tracking station level.
-		/// </summary>
-		public static double KerbinRelayRange
-		{
-			get;
-			private set;
-		}
-
-		/// <summary>
-		/// Gets Kerbin's nominal relay range based on the current tracking station level.
-		/// </summary>
-		public static double KerbinNominalRange
-		{
-			get
-			{
-				return KerbinRelayRange / 2.8284271247461901d;
-			}
 		}
 
 #pragma warning disable 1591
@@ -120,11 +87,7 @@
 		private IButton toolbarButton;
 		private ApplicationLauncherButton appLauncherButton;
 
-		private double[] trackingStationRanges;
-
 		private System.Version runningVersion;
-
-		private bool runOnce;
 
 		private KSP.IO.PluginConfiguration _config;
 		private KSP.IO.PluginConfiguration config
@@ -166,63 +129,13 @@
 
 			ARConfiguration.UpdateDelay = this.LoadConfigValue(UPDATE_DELAY_KEY, 16L);
 
-			ARConfiguration.UseAdditiveRanges = this.LoadConfigValue(USE_ADDITIVE_KEY, true);
-
 			this.updateDelayStr = ARConfiguration.UpdateDelay.ToString();
 
 			GameEvents.onGameSceneLoadRequested.Add(this.onSceneChangeRequested);
-			GameEvents.OnKSCFacilityUpgraded.Add(this.onFacilityUpgraded);
 
 			Debug.Log(string.Format("{0} v{1} - ARConfiguration loaded!", this.GetType().Name, this.runningVersion));
 
-			ConfigNode[] tsRangeNodes = GameDatabase.Instance.GetConfigNodes(TRACKING_STATION_RANGES_KEY);
-
-			if (tsRangeNodes.Length > 0)
-			{
-				string[] rangeValues = tsRangeNodes[0].GetValues(RANGE_KEY);
-
-				this.trackingStationRanges = new double[rangeValues.Length];
-
-				for (int idx = 0; idx < rangeValues.Length; idx++)
-				{
-					if (!double.TryParse(rangeValues[idx], out this.trackingStationRanges[idx]))
-					{
-						this.LogError("Could not parse value '{0}' to double; Tracking Station ranges may not work!");
-						this.trackingStationRanges[idx] = 0d;
-					}
-				}
-
-				this.Log("Loaded Tracking Station ranges from config: [{0}]", this.trackingStationRanges.SPrint());
-			}
-			else
-			{
-				this.trackingStationRanges = new double[]
-				{
-					51696576d,
-					37152180000d,
-					224770770000d
-				};
-
-				this.LogWarning("Failed to load Tracking Station ranges from config, using hard-coded values: [{0}]",
-					this.trackingStationRanges.SPrint());
-			}
-
-			this.runOnce = true;
-
 			Tools.PostDebugMessage(this, "Awake.");
-		}
-
-		public void Update()
-		{
-			if (
-				this.runOnce &&
-				(ScenarioUpgradeableFacilities.Instance != null || HighLogic.CurrentGame.Mode != Game.Modes.CAREER)
-			)
-			{
-				this.runOnce = false;
-
-				this.SetKerbinRelayRange();
-			}
 		}
 
 		public void OnGUI()
@@ -323,17 +236,6 @@
 
 			GUILayout.BeginHorizontal();
 
-			bool useAdditive = GUITools.Toggle(ARConfiguration.UseAdditiveRanges, "Use Additive Ranges");
-			if (useAdditive != ARConfiguration.UseAdditiveRanges)
-			{
-				ARConfiguration.UseAdditiveRanges = useAdditive;
-				this.SaveConfigValue(USE_ADDITIVE_KEY, useAdditive);
-			}
-
-			GUILayout.EndHorizontal();
-
-			GUILayout.BeginHorizontal();
-
 			bool prettyLines = GUITools.Toggle(ARConfiguration.PrettyLines, "Draw Pretty Lines");
 			if (prettyLines != ARConfiguration.PrettyLines)
 			{
@@ -392,22 +294,19 @@
 		public void OnDestroy()
 		{
 			GameEvents.onGameSceneLoadRequested.Remove(this.onSceneChangeRequested);
-			GameEvents.OnKSCFacilityUpgraded.Remove(this.onFacilityUpgraded);
 
 			if (this.toolbarButton != null)
 			{
 				this.toolbarButton.Destroy();
-				this.toolbarButton = null;
 			}
 
 			if (this.appLauncherButton != null)
 			{
 				ApplicationLauncher.Instance.RemoveModApplication(this.appLauncherButton);
-				this.appLauncherButton = null;
-			}
-		}
-
-		private void onSceneChangeRequested(GameScenes scene)
+			}
+		}
+
+		protected void onSceneChangeRequested(GameScenes scene)
 		{
 			if (scene != GameScenes.SPACECENTER)
 			{
@@ -416,42 +315,6 @@
 			}
 		}
 
-		private void onFacilityUpgraded(Upgradeables.UpgradeableFacility fac, int lvl)
-		{
-			if (fac.id == "SpaceCenter/TrackingStation")
-			{
-				this.Log("Caught onFacilityUpgraded for {0} at level {1}", fac.id, lvl);
-				this.SetKerbinRelayRange();
-			}
-		}
-
-		private void SetKerbinRelayRange()
-		{
-			int tsLevel;
-
-			if (HighLogic.CurrentGame.Mode == Game.Modes.CAREER)
-			{
-				tsLevel = ScenarioUpgradeableFacilities.protoUpgradeables["SpaceCenter/TrackingStation"]
-					.facilityRefs[0].FacilityLevel;
-			
-
-			}
-			else
-			{
-				tsLevel = this.trackingStationRanges.Length - 1;
-			}
-
-			if (tsLevel < this.trackingStationRanges.Length && tsLevel >= 0)
-			{
-				KerbinRelayRange = this.trackingStationRanges[tsLevel];
-				this.Log("Setting Kerbin's range to {0}", KerbinRelayRange);
-			}
-			else
-			{
-				this.LogError("Could not set Kerbin's range with invalid Tracking Station level {0}", tsLevel);
-			}
-		}
-
 		private void toggleConfigWindow()
 		{
 			this.showConfigWindow = !this.showConfigWindow;

--- a/AntennaRelay.cs
+++ b/AntennaRelay.cs
@@ -200,13 +200,9 @@
 			CelestialBody bodyOccludingBestOccludedRelay = null;
 			IAntennaRelay needle;
 
-			// double nearestRelaySqrDistance = double.PositiveInfinity;
-			// double bestOccludedSqrDistance = double.PositiveInfinity;
-
-			// double maxTransmitSqrDistance = double.NegativeInfinity;
-
-			double nearestRelaySqrQuotient = double.PositiveInfinity;
-			double bestOccludedSqrQuotient = double.PositiveInfinity;
+			double nearestRelaySqrDistance = double.PositiveInfinity;
+			double bestOccludedSqrDistance = double.PositiveInfinity;
+			double maxTransmitSqrDistance = this.maxTransmitDistance * this.maxTransmitDistance;
 
 			/*
 			 * Loop through all the vessels and exclude this vessel, vessels of the wrong type, and vessels that are too
@@ -261,36 +257,20 @@
 					continue;
 				}
 
-				potentialBestRelay = potentialVessel.GetBestRelay();
-				log.AppendFormat("\n\t\tgot best vessel relay {0}",
-					potentialBestRelay == null ? "null" : potentialBestRelay.ToString());
-
-				if (potentialBestRelay == null)
-				{
-					log.Append("\n\t\t...skipping null relay");
-					continue;
-				}
-
 				// Find the distance from here to the vessel...
 				log.Append("\n\tgetting distance to potential vessel");
 				double potentialSqrDistance = this.sqrDistanceTo(potentialVessel);
 				log.Append("\n\tgetting best vessel relay");
 
-				log.Append("\n\tgetting max link distance to potential relay");
-				double maxLinkSqrDistance;
-
-				if (ARConfiguration.UseAdditiveRanges)
-				{
-					maxLinkSqrDistance = this.maxTransmitDistance * potentialBestRelay.maxTransmitDistance;
-				}
-				else
-				{
-					maxLinkSqrDistance = this.maxTransmitDistance * this.maxTransmitDistance;
-				}
-
-				log.AppendFormat("\n\tmax link distance: {0}", maxLinkSqrDistance);
-
-				double potentialSqrQuotient = potentialSqrDistance / maxLinkSqrDistance;
+				potentialBestRelay = potentialVessel.GetBestRelay();
+				log.AppendFormat("\n\t\tgot best vessel relay {0}",
+					potentialBestRelay == null ? "null" : potentialBestRelay.ToString());
+
+				if (potentialBestRelay == null)
+				{
+					log.Append("\n\t\t...skipping null relay");
+					continue;
+				}
 
 				log.Append("\n\t\tdoing LOS check");
 				// Skip vessels to which we do not have line of sight.
@@ -305,12 +285,12 @@
 						this.ToString(), potentialVessel.vesselName);
 					
 					log.AppendFormat("\n\t\t\tpotentialSqrDistance: {0}", potentialSqrDistance);
-					log.AppendFormat("\n\t\t\tbestOccludedSqrQuotient: {0}", bestOccludedSqrQuotient);
-					log.AppendFormat("\n\t\t\tmaxTransmitSqrDistance: {0}", maxLinkSqrDistance);
+					log.AppendFormat("\n\t\t\tbestOccludedSqrDistance: {0}", bestOccludedSqrDistance);
+					log.AppendFormat("\n\t\t\tmaxTransmitSqrDistance: {0}", maxTransmitSqrDistance);
 
 					if (
-						(potentialSqrQuotient < bestOccludedSqrQuotient) &&
-						(potentialSqrQuotient <= 1d) &&
+						(potentialSqrDistance < bestOccludedSqrDistance) &&
+						(potentialSqrDistance < maxTransmitSqrDistance) &&
 						potentialBestRelay.CanTransmit()
 					)
 					{
@@ -319,7 +299,7 @@
 
 						this.bestOccludedRelay = potentialBestRelay;
 						bodyOccludingBestOccludedRelay = fob;
-						bestOccludedSqrQuotient = potentialSqrQuotient;
+						bestOccludedSqrDistance = potentialSqrDistance;
 					}
 					else
 					{
@@ -334,7 +314,7 @@
 				/*
 				 * ...so that we can skip the vessel if it is further away than a vessel we've already checked.
 				 * */
-				if (potentialSqrQuotient > nearestRelaySqrQuotient)
+				if (potentialSqrDistance > nearestRelaySqrDistance)
 				{
 					
 					log.AppendFormat("\n\t{0}: Vessel {1} discarded because it is farther than another the nearest relay.",
@@ -400,13 +380,13 @@
 
 					if (!isCircular)
 					{
-						nearestRelaySqrQuotient = potentialSqrQuotient;
+						nearestRelaySqrDistance = potentialSqrDistance;
 						this.nearestRelay = potentialBestRelay;
 
-						log.AppendFormat("\n\t{0}: found new nearest relay {1} ({2}m²)",
+						log.AppendFormat("\n\t{0}: found new nearest relay {1} ({2}m)",
 							this.ToString(),
 							this.nearestRelay.ToString(),
-							Math.Sqrt(nearestRelaySqrQuotient)
+							Math.Sqrt(nearestRelaySqrDistance)
 						);
 					}
 					else
@@ -422,28 +402,15 @@
 
 			double kerbinSqrDistance = this.vessel.DistanceTo(Kerbin) - Kerbin.Radius;
 			kerbinSqrDistance *= kerbinSqrDistance;
-
-			double kerbinSqrQuotient;
-
-			if (ARConfiguration.UseAdditiveRanges)
-			{
-				kerbinSqrQuotient = kerbinSqrDistance /
-					(this.maxTransmitDistance * ARConfiguration.KerbinRelayRange);
-			}
-			else
-			{
-				kerbinSqrQuotient = kerbinSqrDistance /
-					(this.maxTransmitDistance * this.maxTransmitDistance);
-			}
 
 			log.AppendFormat("\n{0} ({1}): Search done, figuring status.", this.ToString(), this.GetType().Name);
 			log.AppendFormat(
 				"\n{0}: nearestRelay={1} ({2}m²)), bestOccludedRelay={3} ({4}m²), kerbinSqrDistance={5}m²)",
 				this,
 				this.nearestRelay == null ? "null" : this.nearestRelay.ToString(),
-				nearestRelaySqrQuotient,
+				nearestRelaySqrDistance,
 				this.bestOccludedRelay == null ? "null" : this.bestOccludedRelay.ToString(),
-				bestOccludedSqrQuotient,
+				bestOccludedSqrDistance,
 				kerbinSqrDistance
 			);
 
@@ -457,11 +424,11 @@
 
 				// nearestRelaySqrDistance will be infinity if all relays are occluded or none exist.
 				// Therefore, this will only be true if a valid relay is in range.
-				if (nearestRelaySqrQuotient <= 1d)
+				if (nearestRelaySqrDistance <= maxTransmitSqrDistance)
 				{
 					log.AppendFormat("\n\t\tCan transmit to nearby relay {0} ({1} <= {2}).",
 						this.nearestRelay == null ? "null" : this.nearestRelay.ToString(),
-						nearestRelaySqrQuotient, 1d);
+							nearestRelaySqrDistance, maxTransmitSqrDistance);
 
 					this.KerbinDirect = false;
 					this.canTransmit = true;
@@ -472,13 +439,13 @@
 				{
 					log.AppendFormat("\n\t\tCan't transmit to nearby relay {0} ({1} > {2}).",
 						this.nearestRelay == null ? "null" : this.nearestRelay.ToString(),
-						nearestRelaySqrQuotient, 1d);
+							nearestRelaySqrDistance, maxTransmitSqrDistance);
 
 					this.canTransmit = false;
 
 					// If the best occluded relay is closer than Kerbin, check it against the nearest relay.
 					// Since bestOccludedSqrDistance is infinity if there are no occluded relays, this is safe
-					if (bestOccludedSqrQuotient < kerbinSqrQuotient)
+					if (bestOccludedSqrDistance < kerbinSqrDistance)
 					{
 						log.AppendFormat("\n\t\t\tBest occluded relay is closer than Kerbin ({0} < {1})",
 							bestOccludedRelay, kerbinSqrDistance);
@@ -487,10 +454,10 @@
 
 						// If the nearest relay is closer than the best occluded relay, pick it.
 						// Since nearestRelaySqrDistane is infinity if there are no nearby relays, this is safe.
-						if (nearestRelaySqrQuotient < bestOccludedSqrQuotient)
+						if (nearestRelaySqrDistance < bestOccludedSqrDistance)
 						{
 							log.AppendFormat("\n\t\t\t\t...but the nearest relay is closer ({0} < {1}), so picking it.",
-								nearestRelaySqrQuotient, bestOccludedSqrQuotient);
+								nearestRelaySqrDistance, bestOccludedSqrDistance);
 							
 							this.targetRelay = this.nearestRelay;
 							this.firstOccludingBody = null;
@@ -499,7 +466,7 @@
 						else
 						{
 							log.AppendFormat("\n\t\t\t\t...and closer than the nearest relay ({0} >= {1}), so picking it.",
-								nearestRelaySqrQuotient, bestOccludedSqrQuotient);
+								nearestRelaySqrDistance, bestOccludedSqrDistance);
 							
 							this.targetRelay = bestOccludedRelay;
 							this.firstOccludingBody = bodyOccludingBestOccludedRelay;
@@ -512,25 +479,25 @@
 						log.AppendFormat("\n\t\t\tKerbin is closer than the best occluded relay ({0} >= {1})",
 							bestOccludedRelay, kerbinSqrDistance);
 						
+						this.firstOccludingBody = null;
+
 						// If the nearest relay is closer than Kerbin, pick it.
 						// Since nearestRelaySqrDistane is infinity if there are no nearby relays, this is safe.
-						if (nearestRelaySqrQuotient < kerbinSqrQuotient)
+						if (nearestRelaySqrDistance < kerbinSqrDistance)
 						{
 							log.AppendFormat("\n\t\t\t\t...but the nearest relay is closer ({0} < {1}), so picking it.",
-								nearestRelaySqrQuotient, kerbinSqrQuotient);
+								nearestRelaySqrDistance, kerbinSqrDistance);
 							
 							this.KerbinDirect = false;
-							this.firstOccludingBody = null;
 							this.targetRelay = this.nearestRelay;
 						}
 						// Otherwise, pick Kerbin.
 						else
 						{
 							log.AppendFormat("\n\t\t\t\t...and closer than the nearest relay ({0} >= {1}), so picking it.",
-								nearestRelaySqrQuotient, kerbinSqrQuotient);
+								nearestRelaySqrDistance, kerbinSqrDistance);
 							
 							this.KerbinDirect = true;
-							this.firstOccludingBody = bodyOccludingKerbin;
 							this.targetRelay = null;
 						}
 					}
@@ -542,20 +509,20 @@
 				log.AppendFormat("\n\tKerbin is in LOS.");
 
 				// If the nearest relay is closer than Kerbin and in range, transmit to it.
-				if (nearestRelaySqrQuotient <= 1d)
+				if (nearestRelaySqrDistance <= maxTransmitSqrDistance)
 				{
 					log.AppendFormat("\n\t\tCan transmit to nearby relay {0} ({1} <= {2}).",
 						this.nearestRelay == null ? "null" : this.nearestRelay.ToString(),
-						nearestRelaySqrQuotient, 1d);
+							nearestRelaySqrDistance, maxTransmitSqrDistance);
 
 					this.canTransmit = true;
 
 					// If the nearestRelay is closer than Kerbin, use it.
-					if (nearestRelaySqrQuotient < kerbinSqrQuotient)
+					if (nearestRelaySqrDistance < kerbinSqrDistance)
 					{
 						log.AppendFormat("\n\t\t\tPicking relay {0} over Kerbin ({1} < {2}).",
 							this.nearestRelay == null ? "null" : this.nearestRelay.ToString(),
-							nearestRelaySqrQuotient, kerbinSqrQuotient);
+							nearestRelaySqrDistance, kerbinSqrDistance);
 
 						this.KerbinDirect = false;
 						this.targetRelay = this.nearestRelay;
@@ -565,7 +532,7 @@
 					{
 						log.AppendFormat("\n\t\t\tBut picking Kerbin over nearby relay {0} ({1} >= {2}).",
 							this.nearestRelay == null ? "null" : this.nearestRelay.ToString(),
-							nearestRelaySqrQuotient, kerbinSqrQuotient);
+								nearestRelaySqrDistance, kerbinSqrDistance);
 
 						this.KerbinDirect = true;
 						this.targetRelay = null;
@@ -576,13 +543,13 @@
 				{
 					log.AppendFormat("\n\t\tCan't transmit to nearby relay {0} ({1} > {2}).",
 						this.nearestRelay == null ? "null" : this.nearestRelay.ToString(),
-							nearestRelaySqrQuotient, 1d);
+							nearestRelaySqrDistance, maxTransmitSqrDistance);
 
 					// If Kerbin is in range, use it.
-					if (kerbinSqrQuotient <= 1d)
+					if (kerbinSqrDistance <= maxTransmitSqrDistance)
 					{
 						log.AppendFormat("\n\t\t\tCan transmit to Kerbin ({0} <= {1}).",
-							kerbinSqrQuotient, 1d);
+							kerbinSqrDistance, maxTransmitSqrDistance);
 
 						this.canTransmit = true;
 						this.KerbinDirect = true;
@@ -593,13 +560,13 @@
 					else
 					{
 						log.AppendFormat("\n\t\t\tCan't transmit to Kerbin ({0} > {1}).",
-								kerbinSqrQuotient, 1d);
+							kerbinSqrDistance, maxTransmitSqrDistance);
 
 						this.canTransmit = false;
 
 						// If the best occluded relay is closer than Kerbin, check it against the nearest relay.
 						// Since bestOccludedSqrDistance is infinity if there are no occluded relays, this is safe
-						if (bestOccludedSqrQuotient < kerbinSqrQuotient)
+						if (bestOccludedSqrDistance < kerbinSqrDistance)
 						{
 							log.AppendFormat("\n\t\t\tBest occluded relay is closer than Kerbin ({0} < {1})",
 								bestOccludedRelay, kerbinSqrDistance);
@@ -608,10 +575,10 @@
 
 							// If the nearest relay is closer than the best occluded relay, pick it.
 							// Since nearestRelaySqrDistane is infinity if there are no nearby relays, this is safe.
-							if (nearestRelaySqrQuotient < bestOccludedSqrQuotient)
+							if (nearestRelaySqrDistance < bestOccludedSqrDistance)
 							{
 								log.AppendFormat("\n\t\t\t\t...but the nearest relay is closer ({0} < {1}), so picking it.",
-									nearestRelaySqrQuotient, bestOccludedSqrQuotient);
+									nearestRelaySqrDistance, bestOccludedSqrDistance);
 								
 								this.targetRelay = this.nearestRelay;
 								this.firstOccludingBody = null;
@@ -620,7 +587,7 @@
 							else
 							{
 								log.AppendFormat("\n\t\t\t\t...and closer than the nearest relay ({0} >= {1}), so picking it.",
-									nearestRelaySqrQuotient, bestOccludedSqrQuotient);
+									nearestRelaySqrDistance, bestOccludedSqrDistance);
 								
 								this.targetRelay = bestOccludedRelay;
 								this.firstOccludingBody = bodyOccludingBestOccludedRelay;
@@ -637,10 +604,10 @@
 
 							// If the nearest relay is closer than Kerbin, pick it.
 							// Since nearestRelaySqrDistane is infinity if there are no nearby relays, this is safe.
-							if (nearestRelaySqrQuotient < kerbinSqrQuotient)
+							if (nearestRelaySqrDistance < kerbinSqrDistance)
 							{
 								log.AppendFormat("\n\t\t\t\t...but the nearest relay is closer ({0} < {1}), so picking it.",
-									nearestRelaySqrQuotient, kerbinSqrQuotient);
+									nearestRelaySqrDistance, kerbinSqrDistance);
 								
 								this.KerbinDirect = false;
 								this.targetRelay = this.nearestRelay;
@@ -649,7 +616,7 @@
 							else
 							{
 								log.AppendFormat("\n\t\t\t\t...and closer than the nearest relay ({0} >= {1}), so picking it.",
-									nearestRelaySqrQuotient, kerbinSqrQuotient);
+									nearestRelaySqrDistance, kerbinSqrDistance);
 								
 								this.KerbinDirect = true;
 								this.targetRelay = null;

--- a/GameData/AntennaRange/AntennaRange.cfg
+++ b/GameData/AntennaRange/AntennaRange.cfg
@@ -37,13 +37,12 @@
 // maxDataFactor:	The multipler on packetSize that defines the maximum data bandwidth of the antenna.
 // 
 
-// Maximum distance 51696km, about 10% past Minmus
 @PART[longAntenna]:FOR[AntennaRange]:NEEDS[!RemoteTech2]
 {
 	@MODULE[ModuleDataTransmitter]
 	{
 		@name = ModuleLimitedDataTransmitter
-		nominalRange = 169706
+		nominalRange = 1500000
 		maxPowerFactor = 8
 		maxDataFactor = 4
 	}
@@ -59,16 +58,14 @@
 	}
 }
 
-// Maximum distance 37152180km, about 5% past Duna
-// Bonus data transmission when at short range
 @PART[mediumDishAntenna]:FOR[AntennaRange]:NEEDS[!RemoteTech2]
 {
 	@MODULE[ModuleDataTransmitter]
 	{
 		@name = ModuleLimitedDataTransmitter
-		nominalRange = 1130000000
-		maxPowerFactor = 4
-		maxDataFactor = 8
+		nominalRange = 30000000
+		maxPowerFactor = 8
+		maxDataFactor = 4
 	}
 
 	MODULE
@@ -82,16 +79,14 @@
 	}
 }
 
-// Maximum distance 224770770km, about 75% past Eeloo.
 @PART[commDish]:FOR[AntennaRange]:NEEDS[!RemoteTech2]
 {
 	@MODULE[ModuleDataTransmitter]
 	{
 		@name = ModuleLimitedDataTransmitter
-		@packetResourceCost /= 1.414213
-		nominalRange = 5125000000
-		maxPowerFactor = 16
-		maxDataFactor = 2
+		nominalRange = 80000000000
+		maxPowerFactor = 8
+		maxDataFactor = 4
 	}
 
 	MODULE
@@ -105,18 +100,11 @@
 	}
 }
 
-TRACKING_STATION_RANGES
-{
-	range = 48000000
-	range = 226000000000
-	range = 7120000000000
-}
-
 EVA_MODULE
 {
 	name = ModuleLimitedDataTransmitter
 
-	nominalRange = 52
+	nominalRange = 5000
 	maxPowerFactor = 1
 	maxDataFactor = 1
 

--- a/ModuleLimitedDataTransmitter.cs
+++ b/ModuleLimitedDataTransmitter.cs
@@ -381,7 +381,7 @@
 				this.relay.maxTransmitDistance = this.maxTransmitDistance;
 				this.relay.nominalTransmitDistance = this.nominalRange;
 
-				this.UImaxTransmitDistance = string.Format(Tools.SIFormatter, "{0:S3}m", this.maxTransmitDistance);
+				this.UImaxTransmitDistance = Tools.MuMech_ToSI(this.maxTransmitDistance) + "m";
 
 				GameEvents.onPartActionUICreate.Add(this.onPartActionUICreate);
 				GameEvents.onPartActionUIDismiss.Add(this.onPartActionUIDismiss);
@@ -409,17 +409,9 @@
 		/// </summary>
 		public override string GetInfo()
 		{
-			StringBuilder sb = Tools.GetStringBuilder();
-			string text;
-
-			sb.Append(base.GetInfo());
-			sb.AppendFormat(Tools.SIFormatter, "Nominal Range: {0:S3}m\n", this.nominalRange);
-			sb.AppendFormat(Tools.SIFormatter, "Maximum Range: {0:S3}m\n", this.maxTransmitDistance);
-
-			text = sb.ToString();
-
-			Tools.PutStringBuilder(sb);
-
+			string text = base.GetInfo();
+			text += "Nominal Range: " + Tools.MuMech_ToSI((double)this.nominalRange, 2) + "m\n";
+			text += "Maximum Range: " + Tools.MuMech_ToSI((double)this.maxTransmitDistance, 2) + "m\n";
 			return text;
 		}
 
@@ -643,9 +635,6 @@
 		{
 			if (this.actionUIUpdate)
 			{
-				this.UImaxTransmitDistance = string.Format(Tools.SIFormatter, "{0:S3}m", 
-					this.MaxLinkDistance());
-				
 				if (this.CanTransmit())
 				{
 					this.UIrelayStatus = "Connected";
@@ -657,12 +646,10 @@
 				{
 					if (this.relay.firstOccludingBody == null)
 					{
-						this.UItransmitDistance = Tools.MuMech_ToSI(this.transmitDistance) + "m";
 						this.UIrelayStatus = "Out of range";
 					}
 					else
 					{
-						this.UItransmitDistance = "N/A";
 						this.UIrelayStatus = string.Format("Blocked by {0}", this.relay.firstOccludingBody.bodyName);
 					}
 					this.UIpacketSize = "N/A";
@@ -757,13 +744,13 @@
 		// transmission fails (see CanTransmit).
 		private void PreTransmit_SetPacketResourceCost()
 		{
-			if (ARConfiguration.FixedPowerCost || this.transmitDistance <= this.NominalLinkDistance())
+			if (ARConfiguration.FixedPowerCost || this.transmitDistance <= this.nominalRange)
 			{
 				base.packetResourceCost = this._basepacketResourceCost;
 			}
 			else
 			{
-				float rangeFactor = (float)(this.transmitDistance / this.NominalLinkDistance());
+				float rangeFactor = (float)(this.transmitDistance / this.nominalRange);
 				rangeFactor *= rangeFactor;
 
 				base.packetResourceCost = this._basepacketResourceCost
@@ -777,13 +764,13 @@
 		// distance.  packetSize maxes out at _basepacketSize * maxDataFactor.
 		private void PreTransmit_SetPacketSize()
 		{
-			if (!ARConfiguration.FixedPowerCost && this.transmitDistance >= this.NominalLinkDistance())
+			if (!ARConfiguration.FixedPowerCost && this.transmitDistance >= this.nominalRange)
 			{
 				base.packetSize = this._basepacketSize;
 			}
 			else
 			{
-				float rangeFactor = (float)(this.NominalLinkDistance() / this.transmitDistance);
+				float rangeFactor = (float)(this.nominalRange / this.transmitDistance);
 				rangeFactor *= rangeFactor;
 
 				base.packetSize = Mathf.Min(

--- a/RelayExtensions.cs
+++ b/RelayExtensions.cs
@@ -128,50 +128,6 @@
 		}
 
 		/// <summary>
-		/// Calculates the nominal link distance.
-		/// </summary>
-		public static double NominalLinkDistance(this IAntennaRelay relay)
-		{
-			if (ARConfiguration.UseAdditiveRanges)
-			{
-				if (relay.KerbinDirect)
-				{
-					return Math.Sqrt(relay.nominalTransmitDistance * ARConfiguration.KerbinNominalRange);
-				}
-				else
-				{
-					return Math.Sqrt(relay.nominalTransmitDistance * relay.targetRelay.nominalTransmitDistance);
-				}
-			}
-			else
-			{
-				return relay.nominalTransmitDistance;
-			}
-		}
-
-		/// <summary>
-		/// Calculates the maximum link distance.
-		/// </summary>
-		public static double MaxLinkDistance(this IAntennaRelay relay)
-		{
-			if (ARConfiguration.UseAdditiveRanges)
-			{
-				if (relay.KerbinDirect)
-				{
-					return Math.Sqrt(relay.maxTransmitDistance * ARConfiguration.KerbinRelayRange);
-				}
-				else
-				{
-					return Math.Sqrt(relay.maxTransmitDistance * relay.targetRelay.maxTransmitDistance);
-				}
-			}
-			else
-			{
-				return relay.maxTransmitDistance;
-			}
-		}
-
-		/// <summary>
 		/// Gets the <see cref="AntennaRange.ConnectionStatus"/> for this <see cref="Vessel"/>
 		/// </summary>
 		/// <param name="vessel">This <see cref="Vessel"/></param>
@@ -187,10 +143,7 @@
 				if (relay.CanTransmit())
 				{
 					canTransmit = true;
-
-					double quo = relay.transmitDistance / relay.NominalLinkDistance();
-
-					if (quo <= 1d)
+					if (relay.transmitDistance <= relay.nominalTransmitDistance)
 					{
 						return ConnectionStatus.Optimal;
 					}