fix for [#18484] Bullet Crash (possibly because of overlapping rigid body balls)
[blender.git] / extern / bullet2 / src / BulletDynamics / Dynamics / btDiscreteDynamicsWorld.cpp
index ea2e0ad2a2ba97382ca3d62a77893269b5722fe9..457e26b1dc08fc3b9e15cf84558a21882b205f0d 100644 (file)
@@ -725,9 +725,13 @@ void       btDiscreteDynamicsWorld::calculateSimulationIslands()
                        {
                                if (colObj0->isActive() || colObj1->isActive())
                                {
-
-                                       getSimulationIslandManager()->getUnionFind().unite((colObj0)->getIslandTag(),
-                                               (colObj1)->getIslandTag());
+                                       if ((colObj0)->getIslandTag() != -1 && (colObj1)->getIslandTag() != -1)
+                                       {
+                                       
+                                               getSimulationIslandManager()->getUnionFind().unite((colObj0)->getIslandTag(),
+                                                       (colObj1)->getIslandTag());
+                                       }
+                                       
                                }
                        }
                }