Missed a simulation exception on zero mass that should have been an abort event

This commit is contained in:
JoePfeiffer 2024-01-04 06:57:51 -07:00
parent 10909ccf21
commit f25bfda6f2

View File

@ -8,6 +8,7 @@ import org.slf4j.LoggerFactory;
import net.sf.openrocket.aerodynamics.AerodynamicForces; import net.sf.openrocket.aerodynamics.AerodynamicForces;
import net.sf.openrocket.aerodynamics.FlightConditions; import net.sf.openrocket.aerodynamics.FlightConditions;
import net.sf.openrocket.logging.SimulationAbort;
import net.sf.openrocket.logging.WarningSet; import net.sf.openrocket.logging.WarningSet;
import net.sf.openrocket.l10n.Translator; import net.sf.openrocket.l10n.Translator;
import net.sf.openrocket.masscalc.RigidBody; import net.sf.openrocket.masscalc.RigidBody;
@ -330,7 +331,7 @@ public class RK4SimulationStepper extends AbstractSimulationStepper {
store.rocketMass = structureMassData.add( store.motorMass ); store.rocketMass = structureMassData.add( store.motorMass );
if (store.rocketMass.getMass() < MathUtil.EPSILON) { if (store.rocketMass.getMass() < MathUtil.EPSILON) {
throw new SimulationException(trans.get("SimulationStepper.error.totalMassZero")); status.abortSimulation(SimulationAbort.Cause.ACTIVEMASSZERO);
} }
// Calculate the forces from the aerodynamic coefficients // Calculate the forces from the aerodynamic coefficients