svn merge -r 16222:16320 https://svn.blender.org/svnroot/bf-blender/trunk/blender
[blender-staging.git] / source / blender / blenkernel / intern / particle_system.c
index 98bf817381904401d7fdff4e752c2c55a47405bc..4ec9f7a95de13177dc324ec58a9aec9e33db7ae9 100644 (file)
@@ -2301,7 +2301,15 @@ static void add_to_effectors(ListBase *lb, Object *ob, Object *obsrc, ParticleSy
                        }
                }
                else if(pd->forcefield)
+               {
                        type |= PSYS_EC_EFFECTOR;
+                       
+                       if(pd->forcefield == PFIELD_WIND)
+                       {
+                               pd->rng = rng_new(1);
+                               rng_srandom(pd->rng, (unsigned int)(ceil(PIL_check_seconds_timer()))); // use better seed
+                       }
+               }
        }
        
        if(pd && pd->deflect)
@@ -2413,6 +2421,9 @@ void psys_end_effectors(ParticleSystem *psys)
 
                        if(ec->tree)
                                BLI_kdtree_free(ec->tree);
+                       
+                       if(ec->ob->pd && (ec->ob->pd->forcefield == PFIELD_WIND))
+                               rng_free(ec->ob->pd->rng);
                }
 
                BLI_freelistN(lb);