Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenkernel/intern/particle.c')
-rw-r--r--source/blender/blenkernel/intern/particle.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index 6cef9959d8b..74a754c0ca8 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -348,15 +348,17 @@ void free_hair(ParticleSystem *psys, int softbody)
}
void free_keyed_keys(ParticleSystem *psys)
{
- if(psys->particles && psys->particles->keys) {
- ParticleData *pa;
- int i, totpart=psys->totpart;
+ ParticleData *pa;
+ int i;
+ if(psys->particles && psys->particles->keys) {
MEM_freeN(psys->particles->keys);
- for(i=0, pa=psys->particles; i<totpart; i++,pa++){
- pa->keys = NULL;
- pa->totkey = 0;
+ for(i=0, pa=psys->particles; i<psys->totpart; i++, pa++) {
+ if(pa->keys) {
+ pa->keys= NULL;
+ pa->totkey= 0;
+ }
}
}
}