Fix for bug #8206: crash with 0 particle hairs and softbody for the

particle system.
This commit is contained in:
Brecht Van Lommel
2008-02-13 14:40:43 +00:00
parent ffa0fd2f2e
commit eecd818304

View File

@@ -3600,9 +3600,11 @@ static void particles_to_softbody(Object *ob)
renew_softbody(ob, totpoint, totedge);
/* find first BodyPoint index for each particle */
psys->particles->bpi = 0;
for(a=1, pa=psys->particles+1; a<psys->totpart; a++, pa++)
pa->bpi = (pa-1)->bpi + (pa-1)->totkey;
if(psys->totpart > 0) {
psys->particles->bpi = 0;
for(a=1, pa=psys->particles+1; a<psys->totpart; a++, pa++)
pa->bpi = (pa-1)->bpi + (pa-1)->totkey;
}
/* we always make body points */
sb= ob->soft;