MechJeb2

MechJeb2

4M Downloads

Visual Bug with Earlyshutoff / last stage

Joshuawood1998 opened this issue ยท 1 comments

commented

KSP_x64_2024-11-22_09-50-10
KSP_x64_2024-11-22_09-50-25

R-7 Super.zip

Here is 2 screenshots and a craft file from RP-1 showing it

commented

The code here

if (vacStats.Count > 0 && _ascentSettings.LastStage < vacStats[vacStats.Count - 1].KSPStage)
{
GUILayout.BeginVertical(GUI.skin.box);
_ascentSettings.LastStage.Val = Clamp(_ascentSettings.LastStage.Val, 0, Core.StageStats.VacStats.Count - 1);
for (int mjPhase = _ascentSettings.LastStage; mjPhase < Core.StageStats.VacStats.Count; mjPhase++)
{
FuelStats stats = Core.StageStats.VacStats[mjPhase];
if (stats.DeltaV < _ascentSettings.MinDeltaV.Val)
continue;
if (topstage < 0)
topstage = stats.KSPStage;
GUILayout.BeginHorizontal();
GUILayout.Label($"{stats.KSPStage,3} {stats.DeltaV:##,###0} m/s");
if (_ascentSettings.UnguidedStages.Contains(mjPhase))
GUILayout.Label(" (unguided)");
if (_ascentSettings.OptimizeStage == mjPhase)
GUILayout.Label(" (optimize)");
GUILayout.EndHorizontal();
}
GUILayout.EndVertical();
}

assumes that the index in the stage stats is the same as the corresponding KSP stage. When multiple stages have the same number, that is not the case.