diff --git a/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java b/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java index 5d3ba0e07..8e65f29c7 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java +++ b/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java @@ -64,6 +64,7 @@ public class FlightConfiguration implements FlightConfigurableParameter stages = new HashMap(); final protected HashMap motors = new HashMap(); final private Collection activeMotors = new ArrayList(); + final private InstanceMap activeInstances = new InstanceMap(); private int boundsModID = -1; private BoundingBox cachedBounds = new BoundingBox(); @@ -101,6 +102,7 @@ public class FlightConfiguration implements FlightConfigurableParameter> entry: imap.entrySet() ) { - RocketComponent c = entry.getKey(); + RocketComponent c = null; + for(Map.Entry> entry: imap.entrySet() ) { + c = entry.getKey(); if (c instanceof TrapezoidFinSet) { - final TrapezoidFinSet fins = (TrapezoidFinSet) c; - final BodyTube body = (BodyTube) fins.getParent(); - body.removeChild(fins); - - // create a PodSet to hook the fins to - PodSet podset = new PodSet(); - podset.setInstanceCount(fins.getFinCount()); - - body.addChild(podset); - - // put a phantom body tube on the pods - BodyTube podBody = new BodyTube(fins.getRootChord(), 0); - podBody.setName("Pod Body"); - podset.addChild(podBody); - - // change the number of fins to 1 and put the revised - // finset on the podbody - fins.setFinCount(1); - podBody.addChild(fins); + break; } } + final TrapezoidFinSet fins = (TrapezoidFinSet) c; + final BodyTube body = (BodyTube) fins.getParent(); + body.removeChild(fins); + + // create a PodSet to hook the fins to + PodSet podset = new PodSet(); + podset.setInstanceCount(fins.getFinCount()); + + body.addChild(podset); + + // put a phantom body tube on the pods + BodyTube podBody = new BodyTube(fins.getRootChord(), 0); + podBody.setName("Pod Body"); + podset.addChild(podBody); + + // change the number of fins to 1 and put the revised + // finset on the podbody + fins.setFinCount(1); + podBody.addChild(fins); return rocket; }