Fix for [#28823] Boids use uninitialized memory.

* Boids need the random velocity vector always.
This commit is contained in:
Janne Karhu
2011-10-15 01:42:26 +00:00
parent cae655f81f
commit f9c41eaaf8

View File

@@ -1607,8 +1607,8 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P
}
/* -velocity */
if(part->randfac != 0.0f){
/* -velocity (boids need this even if there's no random velocity) */
if(part->randfac != 0.0f || (part->phystype==PART_PHYS_BOIDS && pa->boid)){
r_vel[0] = 2.0f * (PSYS_FRAND(p + 10) - 0.5f);
r_vel[1] = 2.0f * (PSYS_FRAND(p + 11) - 0.5f);
r_vel[2] = 2.0f * (PSYS_FRAND(p + 12) - 0.5f);