DGP - added isCompatible checks for all Rocksim components
[debian/openrocket] / src / net / sf / openrocket / file / rocksim / ParachuteHandler.java
index 6cadaff56cdd3fbd3b800b638c2802170f709da0..44418faefe05ea15f86ae8b9d17c8be58fcac82d 100644 (file)
@@ -32,14 +32,18 @@ class ParachuteHandler extends RecoveryDeviceHandler<Parachute> {
      * Constructor.
      *
      * @param c the parent component
+     * @param warnings  the warning set
+     * 
      * @throws IllegalArgumentException thrown if <code>c</code> is null
      */
-    public ParachuteHandler(RocketComponent c) throws IllegalArgumentException {
+    public ParachuteHandler(RocketComponent c, WarningSet warnings) throws IllegalArgumentException {
         if (c == null) {
             throw new IllegalArgumentException("The parent of a parachute may not be null.");
         }
         chute = new Parachute();
-        c.addChild(chute);
+        if (isCompatible(c, Parachute.class, warnings)) {
+            c.addChild(chute);
+        }
     }
 
     /**