From bcff9ea50e730d1663a824f82325a335a4e33ed5 Mon Sep 17 00:00:00 2001 From: "rem..om" Date: Sat, 15 Mar 2014 14:31:00 +0000 Subject: [PATCH] KinematicRagdollControl now throws a proper exception when the skeleton control is not found on the model. git-svn-id: https://jmonkeyengine.googlecode.com/svn/branches/gradle-restructure@11084 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../java/com/jme3/bullet/control/KinematicRagdollControl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jme3-bullet/src/common/java/com/jme3/bullet/control/KinematicRagdollControl.java b/jme3-bullet/src/common/java/com/jme3/bullet/control/KinematicRagdollControl.java index 13e49213c..c1456adff 100644 --- a/jme3-bullet/src/common/java/com/jme3/bullet/control/KinematicRagdollControl.java +++ b/jme3-bullet/src/common/java/com/jme3/bullet/control/KinematicRagdollControl.java @@ -355,6 +355,9 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P //I remove the skeletonControl and readd it to the spatial to make sure it's after the ragdollControl in the stack //Find a proper way to order the controls. SkeletonControl sc = model.getControl(SkeletonControl.class); + if(sc == null){ + throw new IllegalArgumentException("The root node of the model should have a SkeletonControl. Make sure the control is there and that it's not on a sub node."); + } model.removeControl(sc); model.addControl(sc);