Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions MechJeb2/Maneuver/OperationTransfer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ protected override List<ManeuverParameters> MakeNodesImpl(Orbit o, double univer

Orbit targetOrbit = target.TargetOrbit;

double lagTime = !MatchOrbit ? LagTime.Val : 0;
// "Match orbit" and "Arrival delay" belong to the two-burn transfer: the one-burn flyby or intercept always aims at the target,
// whatever they were left at
bool matchOrbit = Capture && MatchOrbit;
double lagTime = !matchOrbit && Capture ? LagTime.Val : 0;

bool fixedTime = false;

Expand All @@ -84,7 +87,7 @@ protected override List<ManeuverParameters> MakeNodesImpl(Orbit o, double univer
}

(Vector3d dV1, double ut1, Vector3d dV2, double ut2) =
OrbitalManeuverCalculator.DeltaVAndTimeForHohmannTransfer(o, targetOrbit, universalTime, lagTime, fixedTime, Coplanar, Capture && !MatchOrbit,
OrbitalManeuverCalculator.DeltaVAndTimeForHohmannTransfer(o, targetOrbit, universalTime, lagTime, fixedTime, Coplanar, !matchOrbit,
Capture);

// the arrival node only where the window offers it (its ViewUpdate clears PlanCapture elsewhere, and kOS has no window)
Expand Down
Loading