Probably fixed the flickering lines by only checking one relay per inactive vessel, and by setting BestVesselRelay per vessel in RelayDatabase.
[AntennaRange.git] / RelayDatabase.cs
blob:a/RelayDatabase.cs -> blob:b/RelayDatabase.cs
--- a/RelayDatabase.cs
+++ b/RelayDatabase.cs
@@ -143,6 +143,7 @@
 			}
 			else
 			{
+				var dump = this[vessel];
 				return null;
 			}
 		}
@@ -358,7 +359,7 @@
 								module
 							));
 
-							relay = (module as IAntennaRelay);
+							relay = new ProtoAntennaRelay(module as IAntennaRelay, pps);
 
 							if (relay.maxTransmitDistance > bestRelayRange)
 							{
@@ -367,7 +368,7 @@
 							}
 
 							// ...build a new ProtoAntennaRelay and add it to the table
-							relays.Add(new ProtoAntennaRelay(relay, pps));
+							relays.Add(relay);
 							// ...neglect relay objects after the first in each part.
 							break;
 						}