Skip to content
4 changes: 3 additions & 1 deletion MechJeb2/MechJebModuleStagingController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ public override void OnFixedUpdate()
if (!InverseStageHasActiveEngines(Vessel.currentStage))
{
Stage();
return;
}

// prevent staging when the current stage has active engines and the next stage has any engines (but not decouplers or clamps)
Expand All @@ -339,6 +340,7 @@ public override void OnFixedUpdate()
if (InverseStageDecouplesDeactivatedEngineOrTank(Vessel.currentStage - 1))
{
Stage();
return;
}

// only decouple fairings if the dynamic pressure, altitude, and aerothermal flux conditions are respected
Expand Down Expand Up @@ -478,7 +480,7 @@ private double LastNonZeroDVStageBurnTime()
private bool InverseStageHasActiveEngines(int inverseStage)
{
foreach (ModuleEngines engine in _allModuleEngines)
if (engine.part.inverseStage == inverseStage && engine.EngineHasFuel())
if (engine.part.inverseStage >= inverseStage && engine.EngineHasFuel())
return true;
return false;
}
Expand Down