rigidbody: Fix [#34106] Deleting an object with Bullet Constraint crashes Blender
Constraints are deleted before rigid bodies so need to check if constraint exists in case both the constraint and ridid body are on the same object.
This commit is contained in:
@@ -853,7 +853,7 @@ void BKE_rigidbody_remove_object(Scene *scene, Object *ob)
|
||||
if (rbw->constraints) {
|
||||
for (go = rbw->constraints->gobject.first; go; go = go->next) {
|
||||
Object *obt = go->ob;
|
||||
if (obt) {
|
||||
if (obt && obt->rigidbody_constraint) {
|
||||
rbc = obt->rigidbody_constraint;
|
||||
if (rbc->ob1 == ob) {
|
||||
rbc->ob1 = NULL;
|
||||
|
||||
Reference in New Issue
Block a user