Bugfix for regression from 2.46 on cloth collisions reported by Daniel Salazar via IRC
authorDaniel Genrich <daniel.genrich@gmx.net>
Tue, 14 Oct 2008 11:50:30 +0000 (11:50 +0000)
committerDaniel Genrich <daniel.genrich@gmx.net>
Tue, 14 Oct 2008 11:50:30 +0000 (11:50 +0000)
source/blender/blenkernel/intern/collision.c

index b8f5b467c11ca3e972342920b8ce77f1cd6dd589..e8cec7e1852228759ad0bf34e83e12bb11fda49f 100644 (file)
@@ -1313,16 +1313,16 @@ CollisionModifierData **get_collisionobjects(Object *self, int *numcollobj)
                
                coll_ob = base->object;
                
+               if(coll_ob == self)
+                               continue;
+               
                if(coll_ob->pd && coll_ob->pd->deflect)
                {
                        collmd = ( CollisionModifierData * ) modifiers_findByType ( coll_ob, eModifierType_Collision );
                }
                
                if ( collmd )
-               {
-                       if(coll_ob == self)
-                               continue;
-                       
+               {       
                        if(numobj >= maxobj)
                        {
                                // realloc
@@ -1351,6 +1351,9 @@ CollisionModifierData **get_collisionobjects(Object *self, int *numcollobj)
                                        coll_ob = go->ob;
                                        collmd = NULL;
                                        
+                                       if(coll_ob == self)
+                                               continue;
+                                       
                                        if(coll_ob->pd && coll_ob->pd->deflect)
                                        {
                                                collmd = ( CollisionModifierData * ) modifiers_findByType ( coll_ob, eModifierType_Collision );
@@ -1358,9 +1361,6 @@ CollisionModifierData **get_collisionobjects(Object *self, int *numcollobj)
 
                                        if ( !collmd )
                                                continue;
-
-                                       if(coll_ob == self)
-                                               continue;
                                        
                                        if( !collmd->bvhtree)
                                                continue;