Don't stage too quickly.

This commit is contained in:
Casper V. Kristensen 2019-02-08 18:45:13 +01:00
parent b93d229ff5
commit 121581f227
Signed by: caspervk
GPG key ID: 289CA03790535054
3 changed files with 6 additions and 5 deletions

View file

@ -8,9 +8,9 @@ set TERMINAL:width to 50.
set TERMINAL:height to 30. set TERMINAL:height to 30.
CORE:doaction("Open Terminal", true). CORE:doaction("Open Terminal", true).
print "=================== BOOTING ===================". print "==================== BOOTING =====================".
wait until SHIP:loaded and SHIP:unpacked. wait until SHIP:loaded and SHIP:unpacked.
wait 0.001. wait 0.001. // wait one physics tick
if HOMECONNECTION:isconnected { if HOMECONNECTION:isconnected {
copy_scripts(). copy_scripts().
@ -18,7 +18,7 @@ if HOMECONNECTION:isconnected {
print "No connection to KSC: not updating scripts.". print "No connection to KSC: not updating scripts.".
} }
print "=========== BOOT SEQUENCE COMPLETE ============". print "============= BOOT SEQUENCE COMPLETE =============".
function copy_scripts { function copy_scripts {

View file

@ -60,6 +60,7 @@ function launch {
// Enable auto-staging // Enable auto-staging
when should_stage() then { when should_stage() then {
stage_when_ready(). stage_when_ready().
wait 0.5.
return true. // preserve trigger return true. // preserve trigger
} }

View file

@ -20,8 +20,8 @@ function should_stage {
// Return true if the rocket needs to stage. // Return true if the rocket needs to stage.
// //
return STATUS = "PRELAUNCH" // e.g. still attached to launch tower return STATUS = "PRELAUNCH" // e.g. still attached to launch tower
or any_flameout() // any engine starved for fuel or any_flameout() // any engine starved for fuel
or SHIP:maxthrustat(0) = 0. // no active engines (e.g. when we have an intermediate stage for decouplers before activating the next engine) or SHIP:maxthrustat(0) = 0. // no active engines (e.g. when we have an intermediate stage for decouplers before activating the next engine)
} }