Refigured the whole way target relays are found; mostly works. PrettyLinesDev2_Broken
[AntennaRange.git] / ModuleLimitedDataTransmitter.cs
blob:a/ModuleLimitedDataTransmitter.cs -> blob:b/ModuleLimitedDataTransmitter.cs
--- a/ModuleLimitedDataTransmitter.cs
+++ b/ModuleLimitedDataTransmitter.cs
@@ -148,6 +148,19 @@
 				}
 
 				return this.relay.bestOccludedRelay;
+			}
+		}
+
+		public IAntennaRelay targetRelay
+		{
+			get
+			{
+				if (this.relay == null)
+				{
+					return null;
+				}
+
+				return this.relay.targetRelay;
 			}
 		}
 
@@ -638,18 +651,11 @@
 
 				if (this.KerbinDirect)
 				{
-					if (this.relay.bestOccludedRelay != null)
-					{
-						this.UIrelayTarget = this.relay.bestOccludedRelay.ToString();
-					}
-					else
-					{
-						this.UIrelayTarget = "Kerbin";
-					}
+					this.UIrelayTarget = AntennaRelay.Kerbin.bodyName;
 				}
 				else
 				{
-					this.UIrelayTarget = this.relay.nearestRelay.ToString();
+					this.UIrelayTarget = this.targetRelay.ToString();
 				}
 			}
 		}