Fixes to make flight engineer use correct gravity and velocity
[VesselSimulator.git] / KerbalEngineer / Flight / Readouts / Vessel / SimulationProcessor.cs
blob:a/KerbalEngineer/Flight/Readouts/Vessel/SimulationProcessor.cs -> blob:b/KerbalEngineer/Flight/Readouts/Vessel/SimulationProcessor.cs
--- a/KerbalEngineer/Flight/Readouts/Vessel/SimulationProcessor.cs
+++ b/KerbalEngineer/Flight/Readouts/Vessel/SimulationProcessor.cs
@@ -43,7 +43,6 @@
         public void Update()
         {
             SimManager.RequestSimulation();
-            SimManager.TryStartSimulation();
 
             if (!SimManager.ResultsReady())
             {
@@ -57,6 +56,16 @@
             {
                 ShowDetails = true;
             }
+
+
+            if (FlightGlobals.ActiveVessel != null)
+            {
+                SimManager.Gravity = FlightGlobals.ActiveVessel.mainBody.gravParameter / Math.Pow(FlightGlobals.ActiveVessel.mainBody.Radius + FlightGlobals.ActiveVessel.mainBody.GetAltitude(FlightGlobals.ActiveVessel.CoM), 2);
+                SimManager.Velocity = FlightGlobals.ActiveVessel.srfSpeed;
+            }
+            // We should be allowing this to be set too...
+            //SimManager.vectoredThrust = vectoredThrust; 
+            SimManager.TryStartSimulation();
         }
 
         public bool UpdateRequested { get; set; }