From 0381be91ca98caa1024d53baf8f2eb102ed02ff8 Mon Sep 17 00:00:00 2001 From: JoePfeiffer Date: Wed, 30 Sep 2020 20:40:28 -0600 Subject: [PATCH] Check that next symmetric component, if non-null, is active --- .../sf/openrocket/aerodynamics/BarrowmanCalculator.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/src/net/sf/openrocket/aerodynamics/BarrowmanCalculator.java b/core/src/net/sf/openrocket/aerodynamics/BarrowmanCalculator.java index 40af97cf2..b8812a7ee 100644 --- a/core/src/net/sf/openrocket/aerodynamics/BarrowmanCalculator.java +++ b/core/src/net/sf/openrocket/aerodynamics/BarrowmanCalculator.java @@ -641,7 +641,7 @@ public class BarrowmanCalculator extends AbstractAerodynamicCalculator { if (!(c instanceof SymmetricComponent)) continue; - + SymmetricComponent s = (SymmetricComponent) c; // iterate across component instances @@ -671,8 +671,10 @@ public class BarrowmanCalculator extends AbstractAerodynamicCalculator { // if I'm the last component, set my base CD // note: the iterator *should* serve up the next component.... buuuut .... - // this code has is tested, and there's no compelling reason to change. - if (s.getNextSymmetricComponent() == null) { + // this code has is tested, and there's no compelling reason to change. + final SymmetricComponent n = s.getNextSymmetricComponent(); + if ((n == null) || + !configuration.isStageActive(n.getStageNumber())) { double area = Math.PI * pow2(s.getAftRadius()); double cd = base * area / conditions.getRefArea(); total += cd;