General cleanup of SimManager start-up and calling.
General cleanup of SimManager start-up and calling.

--- a/VOIDCore_Generic.cs
+++ b/VOIDCore_Generic.cs
@@ -95,8 +95,9 @@
 		[AVOID_SaveValue("timeScaleFlags")]
 		protected VOID_SaveValue<UInt32> timeScaleFlags;
 
-		// Vessel Type Housekeeping
+		// Load-up housekeeping
 		protected bool vesselTypesLoaded = false;
+		protected bool simManagerLoaded = false;
 
 		protected string defaultSkin = "KSP window 2";
 
@@ -741,18 +742,14 @@
 
 		protected void UpdateSimManager()
 		{
-			if (HighLogic.LoadedSceneIsEditor)
-			{
-				SimManager.Gravity = VOID_Data.KerbinGee;
-			}
-			else
+			if (HighLogic.LoadedSceneIsFlight)
 			{
 				double radius = this.Vessel.Radius();
 				SimManager.Gravity = this.Vessel.mainBody.gravParameter / (radius * radius);
 				SimManager.Atmosphere = this.Vessel.staticPressurekPa * PhysicsGlobals.KpaToAtmospheres;
-				SimManager.Mach = HighLogic.LoadedSceneIsEditor ? 1d :  this.Vessel.mach;
-				BuildAdvanced.Altitude = HighLogic.LoadedSceneIsEditor ? 0d : this.Vessel.altitude;
-				CelestialBodies.SelectedBody = HighLogic.LoadedSceneIsEditor ? this.HomeBody : this.Vessel.mainBody;
+				SimManager.Mach = this.Vessel.mach;
+				BuildAdvanced.Altitude = this.Vessel.altitude;
+				CelestialBodies.SelectedBody = this.Vessel.mainBody;
 			}
 
 			#if DEBUG
@@ -972,6 +969,18 @@
 				Debug.Log(string.Format("sortedBodyList: {0}", string.Join("\n\t", this.SortedBodyList.Select(b => b.bodyName).ToArray())));
 			}
 
+			// SimManager initialization that we don't necessarily want to repeat every Update.
+			if (!this.simManagerLoaded && this.HomeBody != null)
+			{
+				SimManager.Gravity = VOID_Data.KerbinGee;
+				SimManager.Atmosphere = 0d;
+				SimManager.Mach = 1d;
+				CelestialBodies.SelectedBody = this.HomeBody;
+				BuildAdvanced.Altitude = 0d;
+				SimManager.OnReady += this.GetSimManagerResults;
+
+				this.simManagerLoaded = true;
+			}
 		}
 
 		protected void InitializeToolbarButton()
@@ -1160,13 +1169,6 @@
 
 			this.vesselSimActive = (VOID_SaveValue<bool>)true;
 
-			SimManager.Atmosphere = 0d;
-			SimManager.Mach = 1d;
-			CelestialBodies.SelectedBody = this.HomeBody;
-			BuildAdvanced.Altitude = 0d;
-
-			SimManager.OnReady += this.GetSimManagerResults;
-
 			this.useToolbarManager = ToolbarManager.ToolbarAvailable;
 
 			this.LoadConfig();

--- a/VOID_EditorHUD.cs
+++ b/VOID_EditorHUD.cs
@@ -118,8 +118,6 @@
 		{
 			StringBuilder hudString = new StringBuilder();
 
-			SimManager.TryStartSimulation();
-
 			if (this.core.LastStage == null)
 			{
 				return;

--- a/VOID_TWR.cs
+++ b/VOID_TWR.cs
@@ -3,11 +3,9 @@
 // This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. To view a
 // copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/
 
+using KerbalEngineer.VesselSimulator;
 using KSP;
 using System;
-using System.Collections.Generic;
-using System.Linq;
-using ToadicusTools;
 using UnityEngine;
 
 namespace VOID
@@ -28,7 +26,7 @@
 				(TimeWarp.CurrentRate <= TimeWarp.MaxPhysicsRate)
 			)
 			{
-				KerbalEngineer.VesselSimulator.SimManager.RequestSimulation();
+				SimManager.RequestSimulation();
 			}
 
 			GUILayout.BeginVertical();