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,21 +546,17 @@ public class Rocket extends ComponentAssembly {
* Update all the stage numbers based on their position in the component tree
*/
private void updateStageNumbers() {
for (RocketComponent component : getChildren()) {
if (component instanceof AxialStage) {
AxialStage stage = (AxialStage) component;
forgetStage(stage);
stage.setStageNumber(getChildPosition(stage));
}
int stageNr = 0;
for (AxialStage stage : getSubStages()) {
forgetStage(stage);
stage.setStageNumber(stageNr);
stageNr++;
}
}
private void updateStageMap(){
for( RocketComponent component : getChildren() ){
if (component instanceof AxialStage) {
AxialStage stage = (AxialStage) component;
trackStage(stage);
}
for (AxialStage stage : getSubStages() ){
trackStage(stage);
}
}