SSTUTools.SSTUModularBooster.updateThrustOutput C# (CSharp) Method

updateThrustOutput() private method

Update the engines min and max thrust values based on the currently selected main tank segment
private updateThrustOutput ( ) : void
return void
        private void updateThrustOutput()
        {
            float scale = diameterForThrustScaling == -1 ? currentMainModule.currentDiameterScale : (currentDiameter / diameterForThrustScaling);
            scale = Mathf.Pow(scale, thrustScalePower);
            if (engineModule == null) { engineModule = part.GetComponent<ModuleEnginesFX>(); }
            if (engineModule != null)
            {
                float minThrust = scale * currentMainModule.minThrust;
                float maxThrust = scale * currentMainModule.maxThrust;
                if (thrustCurveCache == null) { thrustCurveCache = engineModule.thrustCurve; }
                SSTUStockInterop.updateEngineThrust(engineModule, minThrust, maxThrust);
                engineModule.thrustCurve = thrustCurveCache;
                engineModule.useThrustCurve = thrustCurveCache.Curve.length > 1;
                updateEngineGuiStats();
            }
        }