Removing some debug stuff, and trying to fix up TDNProtoUpdater exp
Removing some debug stuff, and trying to fix up TDNProtoUpdater

--- a/TweakableControlSurfaces/ModuleTweakableControlSurface.cs
+++ b/TweakableControlSurfaces/ModuleTweakableControlSurface.cs
@@ -26,7 +26,7 @@
 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-// @TODO: Remove module; looks like it's all stock now.
+// TODO: Remove module; looks like it's all stock now.
 
 using KSP;
 using System;

--- a/TweakableDockingNode/ModuleTweakableDockingNode.cs
+++ b/TweakableDockingNode/ModuleTweakableDockingNode.cs
@@ -80,7 +80,7 @@
 		[KSPField(isPersistant = false)]
 		public bool AlwaysAllowStack;
 
-		[KSPField(isPersistant = true, guiActive = true, guiActiveEditor = true)]
+		[KSPField(isPersistant = true, guiActive = false, guiActiveEditor = false)]
 		public float minCaptureRollDotProduct;
 
 		/// <summary>
@@ -97,7 +97,7 @@
 
 		public float lastMaxCaptureRollAngle;
 
-		[KSPField(isPersistant = true, guiActive = true, guiActiveEditor = true)]
+		[KSPField(isPersistant = true, guiActive = false, guiActiveEditor = false)]
 		public float minAcquireRollDotProduct;
 
 		/// <summary>
@@ -262,8 +262,10 @@
 			this.maxAcquireRollAngle = Mathf.Acos(this.minAcquireRollDotProduct) * 180f / Mathf.PI;
 			this.dockingNodeModule.acquireMinRollDot = Mathf.Min(this.minAcquireRollDotProduct, 0.99995f);
 
+			#if DEBUG
 			this.dockingNodeModule.Fields["captureMinRollDot"].guiActive = true;
 			this.dockingNodeModule.Fields["captureMinRollDot"].guiActiveEditor = true;
+			#endif
 
 			this.lastMaxCaptureRollAngle = this.maxCaptureRollAngle;
 			this.lastMaxAcquireRollAngle = this.maxAcquireRollAngle;
@@ -275,15 +277,6 @@
 			}
 
 			base.part.attachRules.allowStack = this.IsOpen | this.AlwaysAllowStack;
-
-			this.dockingNodeModule.Events["EnableXFeed"].guiActive = false;
-			this.dockingNodeModule.Events["DisableXFeed"].guiActive = false;
-
-			this.dockingNodeModule.Events["EnableXFeed"].guiActiveEditor = false;
-			this.dockingNodeModule.Events["DisableXFeed"].guiActiveEditor = false;
-
-			this.dockingNodeModule.Events["EnableXFeed"].active = false;
-			this.dockingNodeModule.Events["DisableXFeed"].active = false;
 
 			/* @subclass
 			ModuleStagingToggle stagingToggleModule;

--- a/TweakableDockingNode/TDNProtoUpdater.cs
+++ b/TweakableDockingNode/TDNProtoUpdater.cs
@@ -54,6 +54,7 @@
 		// in case someone has changed it.
 		public virtual void Awake()
 		{
+			this.Log("Waking up.");
 			var config = KSP.IO.PluginConfiguration.CreateForType<TDNProtoUpdater>(null);
 
 			config.load();
@@ -67,6 +68,7 @@
 					partStrings[idx] = partStrings[idx].Trim();
 				}
 			}
+			this.Log("Awake.");
 		}
 
 		// Check each of the affected parts snapshots to see if they are missing any AttachNodes.  If so, add them.
@@ -260,18 +262,23 @@
 	[KSPAddon(KSPAddon.Startup.Flight, false)]
 	public class TDNProtoUpdater_Flight : TDNProtoUpdater
 	{
-		// Runs once when the plugin wakes up.  Any later and the vessel loader will throw an exception.
-		public override void Awake()
-		{
+		public void Update()
+		{
+			// Don't run if Flight isn't ready yet.
+			if (
+				FlightDriver.FlightStateCache == null ||
+				FlightDriver.FlightStateCache.flightState == null ||
+				FlightDriver.FlightStateCache.flightState.protoVessels == null
+			)
+			{
+				return;
+			}
+
 			// We only need to run this code if we're reloading from a saved cache, as in quickloading.
 			if (FlightDriver.StartupBehaviour != FlightDriver.StartupBehaviours.RESUME_SAVED_CACHE)
 			{
 				return;
 			}
-				
-			base.Awake();
-
-			// Tools.PostDebugMessage(this.GetType().Name + ": Awake started.  Flight StartupBehavior: " + FlightDriver.StartupBehaviour);
 
 			// Fetch all the affected parts from the flight state cache.
 			/*IEnumerable<ProtoPartSnapshot> affectedParts = FlightDriver.FlightStateCache.flightState.protoVessels
@@ -302,8 +309,9 @@
 				}
 			}
 
-
 			this.UpdateProtoPartSnapshots(affectedParts);
+
+			runOnce = true;
 		}
 	}
 }