rigidbody: Properly handle constrained objects not having rigid bodies

This is a pretty rare case that can be triggered by switching rigid body
and constraint groups before simulation was validated.
Code checked for existing physics objects but was missing else block.
This commit is contained in:
Sergej Reich
2013-02-20 00:45:53 +00:00
parent 6adb526f31
commit 2f0eec488c

View File

@@ -635,6 +635,9 @@ void BKE_rigidbody_validate_sim_constraint(RigidBodyWorld *rbw, Object *ob, shor
break;
}
}
else { /* can't create constraint without both rigid bodies */
return;
}
RB_constraint_set_enabled(rbc->physics_constraint, rbc->flag & RBC_FLAG_ENABLED);