Merge pull request #1064 from JoePfeiffer/fix-1007

Copy stageMap when loading a rocket's parameters from another rocket
This commit is contained in:
SiboVG 2021-12-14 22:37:13 +01:00 committed by GitHub
commit 52314dbc81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View File

@ -727,9 +727,7 @@ public class OpenRocketDocument implements ComponentChangeListener {
}
rocket.checkComponentStructure();
undoHistory.get(undoPosition).checkComponentStructure();
undoHistory.get(undoPosition).copyWithOriginalID().checkComponentStructure();
rocket.loadFrom(undoHistory.get(undoPosition).copyWithOriginalID());
rocket.loadFrom(undoHistory.get(undoPosition));
rocket.checkComponentStructure();
}

View File

@ -387,6 +387,7 @@ public class Rocket extends ComponentAssembly {
this.functionalModID = r.functionalModID;
this.refType = r.refType;
this.customReferenceLength = r.customReferenceLength;
this.stageMap = r.stageMap;
// these flight configurations need to reference the _this_ Rocket:
this.configSet.setDefault(new FlightConfiguration(this));