Fix bugs in hover/landing code.

This commit is contained in:
Anna Rose 2021-08-29 21:45:50 -04:00
parent c3bfd4c650
commit 7f8fc751d4

View File

@ -51,8 +51,8 @@ function Hover {
restoreControl(). restoreControl().
} }
function hoverVectorVac { function hoverDirVac {
parameter top. parameter top is SHIP:FACING:TOPVECTOR.
if SHIP:VERTICALSPEED > 0 { if SHIP:VERTICALSPEED > 0 {
return SHIP:UP. return SHIP:UP.
} }
@ -60,12 +60,12 @@ function hoverVectorVac {
} }
function alignForHover { function alignForHover {
set top to SHIP:FACING:FOREVECTOR. set top to SHIP:FACING:TOPVECTOR.
if ReadSensor("PRES") = 0 { if ReadSensor("PRES") = 0 {
// if we're in a vacuum, align with retrograde for smoother horizontal control. // if we're in a vacuum, align with retrograde for smoother horizontal control.
lock STEERING to hoverDirVac(top). lock STEERING to hoverDirVac(top).
print "Aligning with retrograde.". print "Aligning with retrograde.".
wait until done or VAng(SHIP:FACING:FOREVECTOR, hoverDirVac():FOREVECTOR) < 1. wait until done or VAng(SHIP:FACING:FOREVECTOR, hoverDirVac(top):FOREVECTOR) < 1.
if done { if done {
return. return.
} }