From 34fe03c7f25cd06876a79af418ced9f4cfa91226 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Sun, 13 Mar 2016 18:21:30 +0100 Subject: 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. --- source/blender/blenkernel/intern/boids.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/blenkernel/intern/boids.c') diff --git a/source/blender/blenkernel/intern/boids.c b/source/blender/blenkernel/intern/boids.c index 7ce61ec6fab..b4bc83bf94c 100644 --- a/source/blender/blenkernel/intern/boids.c +++ b/source/blender/blenkernel/intern/boids.c @@ -310,6 +310,7 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues * ParticleSystem *epsys = psys_get_target_system(bbd->sim->ob, pt); if (epsys) { + BLI_assert(epsys->tree != NULL); neighbors = BLI_kdtree_range_search__normal( epsys->tree, pa->prev_state.co, pa->prev_state.ave, &ptn, acbr->look_ahead * len_v3(pa->prev_state.vel)); -- cgit v1.2.3