diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-05-28 02:25:54 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-05-28 02:25:54 +0400 |
commit | c498a8f2b4899a6fbad2c8278e29064dc3cdcfaa (patch) | |
tree | 15089e40fa7ab00adcca0c1acc2314ce1506a413 /source/blender/blenkernel/intern | |
parent | 4439eca6547b20eb61c163ac77a4f88972ac6944 (diff) |
fix [#35544] Boids Segfault of frame advance using cursor keys
caused by partial revert of r56073.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/particle_system.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 81c7fc44715..50d2a47a97f 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -4130,6 +4130,7 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra) { ParticleSystem *psys = sim->psys; ParticleSettings *part=psys->part; + RNG *rng; BoidBrainData bbd; ParticleTexture ptex; PARTICLE_P; @@ -4157,6 +4158,8 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra) } BLI_srandom(31415926 + (int)cfra + psys->seed); + /* for now do both, boids us 'rng' */ + rng = BLI_rng_new_srandom(31415926 + (int)cfra + psys->seed); psys_update_effectors(sim); @@ -4173,6 +4176,7 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra) bbd.cfra = cfra; bbd.dfra = dfra; bbd.timestep = timestep; + bbd.rng = rng; psys_update_particle_tree(psys, cfra); @@ -4356,6 +4360,7 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra) } free_collider_cache(&sim->colliders); + BLI_rng_free(rng); } static void update_children(ParticleSimulationData *sim) { |