Fix bug uncovered with ground approximation code.

This commit is contained in:
Anna Rose 2021-08-19 23:57:25 -04:00
parent 05267b0283
commit bf31b4133d
2 changed files with 4 additions and 1 deletions

View File

@ -37,7 +37,7 @@ function Bootstrap {
} else { } else {
set CORE:BOOTFILENAME to "/init". set CORE:BOOTFILENAME to "/init".
} }
// reboot. reboot.
} }
} }

View File

@ -33,6 +33,9 @@ function CreateCircularizationNode {
// REQUIRES a circular orbit. // REQUIRES a circular orbit.
// TODO: it would be great to semi-automate this... // TODO: it would be great to semi-automate this...
function TargetBurnDistance { function TargetBurnDistance {
if not HASTARGET {
return -1.
}
return Sqrt(StoppingDistance()^2 + (SHIP:ORBIT:SEMIMAJORAXIS - SHIP:BODY:RADIUS - TARGET:ALTITUDE)^2). return Sqrt(StoppingDistance()^2 + (SHIP:ORBIT:SEMIMAJORAXIS - SHIP:BODY:RADIUS - TARGET:ALTITUDE)^2).
} }