diff --git a/MechJeb2/MechJebLib/Simulations/PartModules/SimModuleEngines.cs b/MechJeb2/MechJebLib/Simulations/PartModules/SimModuleEngines.cs index e3868b35..3f081da6 100644 --- a/MechJeb2/MechJebLib/Simulations/PartModules/SimModuleEngines.cs +++ b/MechJeb2/MechJebLib/Simulations/PartModules/SimModuleEngines.cs @@ -48,7 +48,7 @@ public class SimModuleEngines : SimPartModule public float FlowMultCap; public float FlowMultCapSharpness; public bool ThrottleLocked; - public float ThrustPercentage; + public float ThrottleLimiter; public bool AtmChangeFlow; public bool UseAtmCurve; public bool UseAtmCurveIsp; @@ -76,10 +76,7 @@ public class SimModuleEngines : SimPartModule private double _machNumber => Part.Vessel.MachNumber; [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Activate() - { - IsOperational = true; - } + public void Activate() => IsOperational = true; [MethodImpl(MethodImplOptions.AggressiveInlining)] public void UpdateEngineStatus() @@ -233,7 +230,7 @@ private double FlowRateAtConditions() if (minFuelFlow == 0 && MinThrust > 0) minFuelFlow = MinThrust / (AtmosphereCurve.Evaluate(0f) * G); if (maxFuelFlow == 0 && MaxThrust > 0) maxFuelFlow = MaxThrust / (AtmosphereCurve.Evaluate(0f) * G); - return Lerp(minFuelFlow, maxFuelFlow, _throttle * 0.01f * ThrustPercentage) * FlowMultiplier; + return Lerp(minFuelFlow, maxFuelFlow, _throttle * 0.01f * ThrottleLimiter) * FlowMultiplier; } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -243,7 +240,7 @@ private void RefreshThrust() ThrustMax = V3.zero; ThrustMin = V3.zero; - double thrustLimiter = ThrustPercentage / 100f; + double thrustLimiter = ThrottleLimiter / 100f; double maxThrust = MaxFuelFlow * FlowMultiplier * ISP * G * MultIsp; double minThrust = MinFuelFlow * FlowMultiplier * ISP * G * MultIsp; diff --git a/MechJeb2/MechJebLib/Simulations/SimVesselUpdater.cs b/MechJeb2/MechJebLib/Simulations/SimVesselUpdater.cs index 35bd006c..b30ad831 100644 --- a/MechJeb2/MechJebLib/Simulations/SimVesselUpdater.cs +++ b/MechJeb2/MechJebLib/Simulations/SimVesselUpdater.cs @@ -158,12 +158,12 @@ private static void UpdateModuleEngines(SimPart part, SimModuleEngines engine, M return; } - engine.IsEnabled = kspEngine.isEnabled; - engine.IsOperational = kspEngine.isOperational; - engine.ThrustPercentage = kspEngine.thrustPercentage; - engine.MultIsp = kspEngine.multIsp; - engine.NoPropellants = kspEngine is { flameout: true, statusL2: "No propellants" }; - engine.ModuleResiduals = 0; + engine.IsEnabled = kspEngine.isEnabled; + engine.IsOperational = kspEngine.isOperational; + engine.ThrottleLimiter = kspEngine.thrustPercentage; + engine.MultIsp = kspEngine.multIsp; + engine.NoPropellants = kspEngine is { flameout: true, statusL2: "No propellants" }; + engine.ModuleResiduals = 0; if (engine.isModuleEnginesRF && _rfPredictedMaximumResiduals!.GetValue(kspEngine) is double doubleVal) engine.ModuleResiduals = doubleVal;