Fixed up some firstOccludingBody bits in [Proto]AntennaRelay.
Fixed up some firstOccludingBody bits in [Proto]AntennaRelay.

--- a/AntennaRelay.cs
+++ b/AntennaRelay.cs
@@ -38,8 +38,6 @@
 		// We don't have a Bard, so we'll hide Kerbin here.
 		protected CelestialBody Kerbin;
 
-		protected CelestialBody _firstOccludingBody;
-
 		protected IAntennaRelay _nearestRelayCache;
 		protected IAntennaRelay moduleRef;
 
@@ -82,15 +80,12 @@
 		}
 
 		/// <summary>
-		/// Gets the first occluding body.
-		/// </summary>
-		/// <value>The first occluding body.</value>
-		public CelestialBody firstOccludingBody
-		{
-			get
-			{
-				return this._firstOccludingBody;
-			}
+		/// Gets the first <see cref="CelestialBody"/> found to be blocking line of sight.
+		/// </summary>
+		public virtual CelestialBody firstOccludingBody
+		{
+			get;
+			protected set;
 		}
 
 		/// <summary>
@@ -144,19 +139,23 @@
 		/// <returns><c>true</c> if this instance can transmit; otherwise, <c>false</c>.</returns>
 		public virtual bool CanTransmit()
 		{
+			CelestialBody fob = null;
+
 			if (
 				this.transmitDistance > this.maxTransmitDistance ||
 				(
 					ARConfiguration.RequireLineOfSight &&
 					this.nearestRelay == null &&
-					!this.vessel.hasLineOfSightTo(this.Kerbin, out this._firstOccludingBody, ARConfiguration.RadiusRatio)
+					!this.vessel.hasLineOfSightTo(this.Kerbin, out fob, ARConfiguration.RadiusRatio)
 				)
 			)
 			{
+				this.firstOccludingBody = fob;
 				return false;
 			}
 			else
 			{
+				this.firstOccludingBody = null;
 				return true;
 			}
 		}
@@ -187,7 +186,7 @@
 				this.vessel.id
 			));
 
-			this._firstOccludingBody = null;
+			this.firstOccludingBody = null;
 
 			// Set this vessel as checked, so that we don't check it again.
 			RelayDatabase.Instance.CheckedVesselsTable[vessel.id] = true;
@@ -229,9 +228,12 @@
 				}
 
 				// Skip vessels to which we do not have line of sight.
+				CelestialBody fob = null;
+
 				if (ARConfiguration.RequireLineOfSight &&
-					!this.vessel.hasLineOfSightTo(potentialVessel, out this._firstOccludingBody, ARConfiguration.RadiusRatio))
-				{
+					!this.vessel.hasLineOfSightTo(potentialVessel, out fob, ARConfiguration.RadiusRatio))
+				{
+					this.firstOccludingBody = fob;
 					Tools.PostDebugMessage(
 						this,
 						"Vessel {0} discarded because we do not have line of sight.",
@@ -239,6 +241,8 @@
 					);
 					continue;
 				}
+
+				this.firstOccludingBody = null;
 
 				// Find the distance from here to the vessel...
 				double potentialSqrDistance = (potentialVessel.GetWorldPos3D() - vessel.GetWorldPos3D()).sqrMagnitude;

--- a/IAntennaRelay.cs
+++ b/IAntennaRelay.cs
@@ -55,6 +55,12 @@
 		float maxTransmitDistance { get; }
 
 		/// <summary>
+		/// The first CelestialBody blocking line of sight to a 
+		/// </summary>
+		/// <value>The first occluding body.</value>
+		CelestialBody firstOccludingBody { get; }
+
+		/// <summary>
 		/// Gets a value indicating whether this <see cref="AntennaRange.ProtoDataTransmitter"/> has been checked during
 		/// the current relay attempt.
 		/// </summary>

--- a/ModuleLimitedDataTransmitter.cs
+++ b/ModuleLimitedDataTransmitter.cs
@@ -137,6 +137,14 @@
 			get
 			{
 				return Mathf.Sqrt (this.maxPowerFactor) * this.nominalRange;
+			}
+		}
+
+		public CelestialBody firstOccludingBody
+		{
+			get
+			{
+				return this.relay.firstOccludingBody;
 			}
 		}
 

--- 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.7.*")]
+[assembly: AssemblyVersion("1.8.*")]
 // 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)]