Revision: 25379
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25379
Author:   blendix
Date:     2009-12-14 20:17:27 +0100 (Mon, 14 Dec 2009)

Log Message:
-----------
Fix crash loading old files with physics systems without effector weights.

Modified Paths:
--------------
    trunk/blender/source/blender/blenloader/intern/readfile.c

Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/readfile.c   2009-12-14 
18:27:38 UTC (rev 25378)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c   2009-12-14 
19:17:27 UTC (rev 25379)
@@ -3128,9 +3128,8 @@
        part->pd= newdataadr(fd, part->pd);
        part->pd2= newdataadr(fd, part->pd2);
 
-       if(part->effector_weights)
-               part->effector_weights = newdataadr(fd, part->effector_weights);
-       else
+       part->effector_weights = newdataadr(fd, part->effector_weights);
+       if(!part->effector_weights)
                part->effector_weights = 
BKE_add_effector_weights(part->eff_group);
 
        link_list(fd, &part->dupliweights);
@@ -3803,9 +3802,8 @@
                                clmd->sim_parms->reset = 0;
                        }
 
-                       if(clmd->sim_parms->effector_weights)
-                               clmd->sim_parms->effector_weights = 
newdataadr(fd, clmd->sim_parms->effector_weights);
-                       else
+                       clmd->sim_parms->effector_weights = newdataadr(fd, 
clmd->sim_parms->effector_weights);
+                       if(!clmd->sim_parms->effector_weights)
                                clmd->sim_parms->effector_weights = 
BKE_add_effector_weights(NULL);
                        
                }
@@ -3832,9 +3830,8 @@
                                smd->domain->tex_shadow = NULL;
                                smd->domain->tex_wt = NULL;
 
-                               if(smd->domain->effector_weights)
-                                       smd->domain->effector_weights = 
newdataadr(fd, smd->domain->effector_weights);
-                               else
+                               smd->domain->effector_weights = newdataadr(fd, 
smd->domain->effector_weights);
+                               if(!smd->domain->effector_weights)
                                        smd->domain->effector_weights = 
BKE_add_effector_weights(NULL);
 
                                direct_link_pointcache_list(fd, 
&(smd->domain->ptcaches[0]), &(smd->domain->point_cache[0]));
@@ -4052,9 +4049,8 @@
                        }
                }
 
-               if(sb->effector_weights)
-                       sb->effector_weights = newdataadr(fd, 
sb->effector_weights);
-               else
+               sb->effector_weights = newdataadr(fd, sb->effector_weights);
+               if(!sb->effector_weights)
                        sb->effector_weights = BKE_add_effector_weights(NULL);
 
                direct_link_pointcache_list(fd, &sb->ptcaches, &sb->pointcache);


_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to