ModuleLimitedDataTransmitter: Implemented nearestRelay.
ModuleLimitedDataTransmitter: Implemented nearestRelay.

--- a/AntennaRelay.cs
+++ b/AntennaRelay.cs
@@ -38,7 +38,7 @@
 		public static bool requireLineOfSight;
 
 		// We don't have a Bard, so we'll hide Kerbin here.
-		protected CelestialBody Kerbin;
+		public static CelestialBody Kerbin;
 
 		protected CelestialBody _firstOccludingBody;
 
@@ -109,7 +109,7 @@
 				if (this.nearestRelay == null)
 				{
 					// .. return the distance to Kerbin
-					return this.DistanceTo(this.Kerbin);
+					return this.DistanceTo(Kerbin);
 				}
 				else
 				{
@@ -151,7 +151,7 @@
 				(
 					requireLineOfSight &&
 					this.nearestRelay == null &&
-					!this.vessel.hasLineOfSightTo(this.Kerbin, out this._firstOccludingBody)
+					!this.vessel.hasLineOfSightTo(Kerbin, out this._firstOccludingBody)
 				)
 			)
 			{
@@ -298,11 +298,14 @@
 			this.moduleRef = module;
 
 			this.searchTimer = new System.Diagnostics.Stopwatch();
-			this.millisecondsBetweenSearches = 5000;
+			this.millisecondsBetweenSearches = 1250;
 
 			// HACK: This might not be safe in all circumstances, but since AntennaRelays are not built until Start,
 			// we hope it is safe enough.
-			this.Kerbin = FlightGlobals.Bodies.FirstOrDefault(b => b.name == "Kerbin");
+			if (AntennaRelay.Kerbin == null)
+			{
+				AntennaRelay.Kerbin = FlightGlobals.Bodies.FirstOrDefault(b => b.name == "Kerbin");
+			}
 		}
 
 		static AntennaRelay()

--- a/IAntennaRelay.cs
+++ b/IAntennaRelay.cs
@@ -42,6 +42,8 @@
 		/// <value>The parent Vessel.</value>
 		Vessel vessel { get; }
 
+		IAntennaRelay nearestRelay { get; }
+
 		/// <summary>
 		/// Gets the distance to the nearest relay or Kerbin, whichever is closer.
 		/// </summary>

--- a/ModuleLimitedDataTransmitter.cs
+++ b/ModuleLimitedDataTransmitter.cs
@@ -123,6 +123,19 @@
 			get
 			{
 				return base.vessel;
+			}
+		}
+
+		public IAntennaRelay nearestRelay
+		{
+			get
+			{
+				if (this.relay == null)
+				{
+					return null;
+				}
+
+				return this.relay.nearestRelay;
 			}
 		}