From 0dc259ab4e21be7776b58ca2a2442c91aac80019 Mon Sep 17 00:00:00 2001 From: Daniel_M_Williams Date: Wed, 6 May 2020 15:38:54 -0400 Subject: [PATCH] [fix] Changed MassCalculator to compare 'MIN_MASS < ', instead of '0==' --- core/src/net/sf/openrocket/masscalc/MassCalculation.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/net/sf/openrocket/masscalc/MassCalculation.java b/core/src/net/sf/openrocket/masscalc/MassCalculation.java index 71836803e..c72aa5e44 100644 --- a/core/src/net/sf/openrocket/masscalc/MassCalculation.java +++ b/core/src/net/sf/openrocket/masscalc/MassCalculation.java @@ -54,7 +54,7 @@ public class MassCalculation { // =========== Instance Functions ======================== public void merge( final MassCalculation other ) { - if( 0 < other.getMass()) { + if( MIN_MASS < other.getMass()) { // Adjust Center-of-mass this.addMass( other.getCM() ); this.bodies.addAll( other.bodies ); @@ -66,7 +66,7 @@ public class MassCalculation { } public void addMass( final Coordinate pointMass ) { - if( 0 == this.centerOfMass.weight ){ + if( MIN_MASS < this.centerOfMass.weight ){ this.centerOfMass = pointMass; }else { this.centerOfMass = this.centerOfMass.average( pointMass); @@ -298,7 +298,7 @@ public class MassCalculation { } } - if( 0 < children.getMass() ) { + if( MIN_MASS < children.getMass() ) { this.merge( children ); // // vvv DEBUG // System.err.println(String.format( "%s....assembly mass (incl/children): %s", prefix, this.toCMDebug())); @@ -398,7 +398,7 @@ public class MassCalculation { } } - if( 0 < children.getMass() ) { + if( MIN_MASS < children.getMass() ) { this.merge( children ); //System.err.println(String.format( "%s....assembly mass (incl/children): %s", prefix, this.toCMDebug())); }