fix [#28336] Particles: setting to zero the count of all elements of a group crashes Blender

This commit is contained in:
Campbell Barton
2011-08-23 12:09:20 +00:00
parent ba4fd78fac
commit 6fd68b8d76

View File

@@ -1351,6 +1351,10 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
continue; continue;
if(part->ren_as==PART_DRAW_GR) { if(part->ren_as==PART_DRAW_GR) {
/* prevent divide by zero below [#28336] */
if(totgroup == 0)
continue;
/* for groups, pick the object based on settings */ /* for groups, pick the object based on settings */
if(part->draw&PART_DRAW_RAND_GR) if(part->draw&PART_DRAW_RAND_GR)
b= BLI_rand() % totgroup; b= BLI_rand() % totgroup;