Crash fix for having wind noise + particles (reported by Wahooney)

This commit is contained in:
Daniel Genrich 2008-08-25 13:49:55 +00:00
parent 683aabae93
commit 10bcba77b1

@ -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);