Merge pull request #2272 from SiboVG/issue-2270

[#2270] Only check axial stages for upper stage, not boosters
This commit is contained in:
Sibo Van Gool 2023-07-27 16:56:18 +02:00 committed by GitHub
commit ced2fb086e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -170,11 +170,11 @@ public class AxialStage extends ComponentAssembly implements FlightConfigurableC
* @return the previous stage in the rocket * @return the previous stage in the rocket
*/ */
public AxialStage getUpperStage() { public AxialStage getUpperStage() {
if( null == this.parent ) { if (this.parent == null) {
return null; return null;
} else if (Rocket.class.isAssignableFrom(this.parent.getClass())) { } else if (Rocket.class.isAssignableFrom(this.parent.getClass())) {
final int thisIndex = getStageNumber(); final int thisIndex = parent.getChildPosition(this);
if( 0 < thisIndex ){ if (thisIndex > 0) {
return (AxialStage) parent.getChild(thisIndex-1); return (AxialStage) parent.getChild(thisIndex-1);
} }
} else { } else {