Replace stage active flag checks with isStageActive

This is more reliable as it takes other factors into account (e.g. if the stage has no children)
This commit is contained in:
SiboVG 2022-09-20 17:48:17 +02:00
parent 26414da9f7
commit 08116c3d32

View File

@ -399,7 +399,7 @@ public class FlightConfiguration implements FlightConfigurableParameter<FlightCo
public AxialStage getBottomStage() {
AxialStage bottomStage = null;
for (StageFlags curFlags : this.stages.values()) {
if (curFlags.active) {
if (isStageActive(curFlags.stageNumber)) {
bottomStage = rocket.getStage( curFlags.stageNumber);
}
}
@ -843,7 +843,7 @@ public class FlightConfiguration implements FlightConfigurableParameter<FlightCo
buf.append(String.format(fmt, "#", "?actv", "Name"));
for (StageFlags flags : stages.values()) {
final int stageNumber = flags.stageNumber;
buf.append(String.format(fmt, stageNumber, (flags.active?" on": "off"), rocket.getStage( stageNumber).getName()));
buf.append(String.format(fmt, stageNumber, (isStageActive(flags.stageNumber) ?" on": "off"), rocket.getStage( stageNumber).getName()));
}
buf.append("\n");
return buf.toString();