From 5193fc9d684e77a67499d5eb0e9ca4c5c497f480 Mon Sep 17 00:00:00 2001 From: "Casper V. Kristensen" Date: Fri, 1 Mar 2019 23:22:17 +0100 Subject: [PATCH] Only wait for fairings to clear the vessel if there are any to deploy. --- ascend.ks | 1 - lib/rocket.ks | 8 ++++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ascend.ks b/ascend.ks index 6ec6c6e..d2d9734 100644 --- a/ascend.ks +++ b/ascend.ks @@ -103,7 +103,6 @@ function launch { if auto_deploy_fairings { deploy_fairings(). - wait 3. // wait for fairings to clear the vessel } if auto_deploy_solar_panels { print "Deploying solar panels". diff --git a/lib/rocket.ks b/lib/rocket.ks index 75138d8..a9b377e 100644 --- a/lib/rocket.ks +++ b/lib/rocket.ks @@ -53,8 +53,12 @@ function isp_sum { function deploy_fairings { print "Deploying fairings". - for module in SHIP:modulesnamed("ModuleProceduralFairing") { - module:doaction("deploy", true). + local fairings is SHIP:modulesnamed("ModuleProceduralFairing"). + for fairing in fairings { + fairing:doaction("deploy", true). + } + if not fairings:empty { + wait 3. // wait for fairings to clear the vessel } }