From b36d802897d1fe82342c35b109b25d8a26255cb2 Mon Sep 17 00:00:00 2001 From: Nnaemeka Abah Date: Sat, 21 Nov 2026 09:40:24 +0100 Subject: [PATCH] Staging: a drop tank with a built-in sepratron still holds the stage HasActiveOrIdleEngineOrTankDescendant skipped sepratron parts entirely, including the check for a tank feeding a running engine. Since running engines with drop tanks defer to those tanks (EnginesHaveDropTanks), a booster tank that carries its own separation motor (RO/RN R-7 blocks B/V/G/D: a throttle-locked solid that activates even if disconnected) left nothing holding the stage, and autostage dropped the boosters right after the launch clamps released. Only the engine test now skips sepratrons; the tank test runs for every part. A real sepratron's own fuel is never matched, since its engine is not in the active engine list, so this only changes parts that are both a tank and a sepratron. Crossfeeding boosters are still dropped once their own tanks are empty. --- MechJeb2/MechJebModuleStagingController.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/MechJeb2/MechJebModuleStagingController.cs b/MechJeb2/MechJebModuleStagingController.cs index 012acbbf2..7cd62140b 100644 --- a/MechJeb2/MechJebModuleStagingController.cs +++ b/MechJeb2/MechJebModuleStagingController.cs @@ -748,10 +748,15 @@ private bool HasActiveOrIdleEngineOrTankDescendant(Part p, List tankResourc if (p is null) return false; - if (!p.IsSepratron() && !IsBurnedOutSrbDecoupledInNextStage(p)) + if (!IsBurnedOutSrbDecoupledInNextStage(p)) { - if ((p.State == PartStates.ACTIVE || p.State == PartStates.IDLE) && p.EngineHasFuel() && !p.IsUnrestartableDeadEngine() && - !EnginesHaveDropTanks(p)) + // a sepratron is not an engine that holds the stage, but its part can still be a drop tank feeding engines + // that are (a booster tank with a built-in separation motor, e.g. the R-7 blocks B/V/G/D). Running engines + // with drop tanks defer to those tanks (EnginesHaveDropTanks), so skipping the tanks here as well would leave + // nothing holding the stage. A real sepratron's own fuel is never matched below: its engine is not in + // activeModuleEngines. + if (!p.IsSepratron() && (p.State == PartStates.ACTIVE || p.State == PartStates.IDLE) && p.EngineHasFuel() && + !p.IsUnrestartableDeadEngine() && !EnginesHaveDropTanks(p)) { return true; // TODO: properly check if ModuleEngines is active }