Fix issue in stage updating for sub-stages

updateStageNumbers would only update direct child stages of the rocket, instead of also ParallelStages
This commit is contained in:
SiboVG 2022-09-24 20:49:23 +02:00
parent 3751b9cd8c
commit b96087e488

View File

@ -546,23 +546,19 @@ public class Rocket extends ComponentAssembly {
* Update all the stage numbers based on their position in the component tree * Update all the stage numbers based on their position in the component tree
*/ */
private void updateStageNumbers() { private void updateStageNumbers() {
for (RocketComponent component : getChildren()) { int stageNr = 0;
if (component instanceof AxialStage) { for (AxialStage stage : getSubStages()) {
AxialStage stage = (AxialStage) component;
forgetStage(stage); forgetStage(stage);
stage.setStageNumber(getChildPosition(stage)); stage.setStageNumber(stageNr);
} stageNr++;
} }
} }
private void updateStageMap(){ private void updateStageMap(){
for( RocketComponent component : getChildren() ){ for (AxialStage stage : getSubStages() ){
if (component instanceof AxialStage) {
AxialStage stage = (AxialStage) component;
trackStage(stage); trackStage(stage);
} }
} }
}
private void updateConfigurations(){ private void updateConfigurations(){
for( FlightConfiguration config : configSet ){ for( FlightConfiguration config : configSet ){