[#1617] Set stage with no children as inactive
This commit is contained in:
parent
ac5ee7537a
commit
6585e07140
@ -241,8 +241,10 @@ public class FlightConfiguration implements FlightConfigurableParameter<FlightCo
|
||||
if( -1 == stageNumber ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return stages.get(stageNumber) != null && stages.get(stageNumber).active;
|
||||
|
||||
AxialStage stage = rocket.getStage(stageNumber);
|
||||
return stage != null && stage.getChildCount() > 0 &&
|
||||
stages.get(stageNumber) != null && stages.get(stageNumber).active;
|
||||
}
|
||||
|
||||
public Collection<RocketComponent> getAllComponents() {
|
||||
@ -379,12 +381,8 @@ public class FlightConfiguration implements FlightConfigurableParameter<FlightCo
|
||||
List<AxialStage> activeStages = new ArrayList<>();
|
||||
|
||||
for (StageFlags flags : this.stages.values()) {
|
||||
if (flags.active) {
|
||||
AxialStage stage = rocket.getStage(flags.stageNumber);
|
||||
if (stage == null) {
|
||||
continue;
|
||||
}
|
||||
activeStages.add(stage);
|
||||
if (isStageActive(flags.stageNumber)) {
|
||||
activeStages.add( rocket.getStage(flags.stageNumber));
|
||||
}
|
||||
}
|
||||
|
||||
@ -392,13 +390,7 @@ public class FlightConfiguration implements FlightConfigurableParameter<FlightCo
|
||||
}
|
||||
|
||||
public int getActiveStageCount() {
|
||||
int activeCount = 0;
|
||||
for (StageFlags cur : this.stages.values()) {
|
||||
if (cur.active) {
|
||||
activeCount++;
|
||||
}
|
||||
}
|
||||
return activeCount;
|
||||
return getActiveStages().size();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user