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:
authorTon Roosendaal <ton@blender.org>2008-09-16 20:20:51 +0400
committerTon Roosendaal <ton@blender.org>2008-09-16 20:20:51 +0400
commit80458f69b29685559c045b068a4383a7684df50c (patch)
treeaf0f56e609346001d1e2892a73a5ff7ca59443a4 /source/blender/blenloader
parent8cd673fdfb9d26f5efcb25541fc57d66284f13a5 (diff)
Added check for failing linking of a ID_PA block.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index fc863ff2f5e..8865e3bb173 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -2598,17 +2598,26 @@ static void direct_link_particlesettings(FileData *fd, ParticleSettings *part)
static void lib_link_particlesystems(FileData *fd, ID *id, ListBase *particles)
{
- ParticleSystem *psys;
+ ParticleSystem *psys, *psysnext;
int a;
- for(psys=particles->first; psys; psys=psys->next){
+ for(psys=particles->first; psys; psys=psysnext){
ParticleData *pa;
+
+ psysnext= psys->next;
+
psys->part = newlibadr_us(fd, id->lib, psys->part);
- psys->target_ob = newlibadr(fd, id->lib, psys->target_ob);
- psys->keyed_ob = newlibadr(fd, id->lib, psys->keyed_ob);
+ if(psys->part) {
+ psys->target_ob = newlibadr(fd, id->lib, psys->target_ob);
+ psys->keyed_ob = newlibadr(fd, id->lib, psys->keyed_ob);
- for(a=0,pa=psys->particles; a<psys->totpart; a++,pa++){
- pa->stick_ob=newlibadr(fd, id->lib, pa->stick_ob);
+ for(a=0,pa=psys->particles; a<psys->totpart; a++,pa++){
+ pa->stick_ob=newlibadr(fd, id->lib, pa->stick_ob);
+ }
+ }
+ else {
+ BLI_remlink(particles, psys);
+ MEM_freeN(psys);
}
}
}