fix for [#18484] Bullet Crash (possibly because of overlapping rigid body balls)
authorCampbell Barton <ideasman42@gmail.com>
Sat, 4 Apr 2009 04:56:05 +0000 (04:56 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 4 Apr 2009 04:56:05 +0000 (04:56 +0000)
simple missing negative index check.

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());
+                                       }
+                                       
                                }
                        }
                }