[#2435] Copy stageMap instead of directly referencing it

This change is to ensure that the stageMap property of the Rocket class is isolated from its source object. Previously, it directly referenced the stageMap of the source, but now we create an entirely new ConcurrentHashMap to hold those stages. This will prevent possible conflicts and unwanted modifications to the source stageMap.
This commit is contained in:
SiboVG 2024-01-22 14:07:46 +01:00
parent 940b913dfa
commit a793f27f51

View File

@ -433,7 +433,7 @@ public class Rocket extends ComponentAssembly {
this.functionalModID = source.functionalModID;
this.refType = source.refType;
this.customReferenceLength = source.customReferenceLength;
this.stageMap = source.stageMap;
this.stageMap = new ConcurrentHashMap<>(source.stageMap);
// these flight configurations need to reference the _this_ Rocket:
this.configSet.reset();