diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-03-13 20:21:30 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-03-13 20:21:30 +0300 |
commit | 34fe03c7f25cd06876a79af418ced9f4cfa91226 (patch) | |
tree | a5d26b842dff3c9f81e8ab8add3228d2119cec53 /source/blender/blenkernel/intern/particle_system.c | |
parent | ed28134f71e2a23aee5818dcb52974930b27de1d (diff) |
Fix T47773: Particle System with Boids Crash.
Problem was, during initialization of boids particles in `dynamics_step()`,
psys of target objects was not obtained with generic `psys_get_target_system()`
as later in code, which could lead to some uninitialized `psys->tree` usage...
Think it's safe enough for 2.77, though not a regression.
Diffstat (limited to 'source/blender/blenkernel/intern/particle_system.c')
-rw-r--r-- | source/blender/blenkernel/intern/particle_system.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 616dd6f27fc..e9ce5329ad0 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -3510,8 +3510,10 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra) boids_precalc_rules(part, cfra); for (; pt; pt=pt->next) { - if (pt->ob) - psys_update_particle_tree(BLI_findlink(&pt->ob->particlesystem, pt->psys-1), cfra); + ParticleSystem *psys_target = psys_get_target_system(sim->ob, pt); + if (psys_target && psys_target != psys) { + psys_update_particle_tree(psys_target, cfra); + } } break; } |