Remove sub-stage from removed component
Fixes a bug where if you delete the parent component of a booster set, it would throw a NullPointerException in BarrowmanCalculator.java:861
This commit is contained in:
parent
4d1e6165a8
commit
9191d9df51
@ -60,7 +60,7 @@ public class FlightConfiguration implements FlightConfigurableParameter<FlightCo
|
||||
}
|
||||
|
||||
/* Cached data */
|
||||
final protected Map<Integer, StageFlags> stages = new HashMap<Integer, StageFlags>();
|
||||
final protected Map<Integer, StageFlags> stages = new HashMap<Integer, StageFlags>(); // Map of stage number to StageFlags of the corresponding stage
|
||||
final protected Map<MotorConfigurationId, MotorConfiguration> motors = new HashMap<MotorConfigurationId, MotorConfiguration>();
|
||||
final private Collection<MotorConfiguration> activeMotors = new ArrayList<MotorConfiguration>();
|
||||
final private InstanceMap activeInstances = new InstanceMap();
|
||||
|
@ -748,6 +748,14 @@ public class Rocket extends ComponentAssembly {
|
||||
fireComponentChangeEvent(ComponentChangeEvent.TREE_CHANGE);
|
||||
return nextConfig.getFlightConfigurationID();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return all the flight configurations of this rocket.
|
||||
* @return all the flight configurations of this rocket.
|
||||
*/
|
||||
public FlightConfigurableParameterSet<FlightConfiguration> getFlightConfigurations() {
|
||||
return this.configSet;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
@ -1545,6 +1545,11 @@ public abstract class RocketComponent implements ChangeSource, Cloneable, Iterab
|
||||
AxialStage stage = (AxialStage) component;
|
||||
this.getRocket().forgetStage(stage);
|
||||
}
|
||||
|
||||
// Remove sub-stages of the removed component
|
||||
for (AxialStage stage : component.getSubStages()) {
|
||||
this.getRocket().forgetStage(stage);
|
||||
}
|
||||
|
||||
this.checkComponentStructure();
|
||||
component.checkComponentStructure();
|
||||
|
Loading…
x
Reference in New Issue
Block a user