Fix for earlier cache commit.
authorJanne Karhu <jhkarh@gmail.com>
Tue, 9 Mar 2010 04:38:51 +0000 (04:38 +0000)
committerJanne Karhu <jhkarh@gmail.com>
Tue, 9 Mar 2010 04:38:51 +0000 (04:38 +0000)
source/blender/blenloader/intern/writefile.c

index 3a5b8e14de366a240520f045461412bfdc106e40..ccd7d5ff9a4ab2affa2da049234c0a18a6a4f90b 100644 (file)
@@ -614,11 +614,11 @@ static void write_pointcaches(WriteData *wd, ListBase *ptcaches)
                        for(; pm; pm=pm->next) {
                                writestruct(wd, DATA, "PTCacheMem", 1, pm);
                                if(pm->index_array)
-                                       writedata(wd, DATA, sizeof(int) * pm->totpoint, pm->index_array);
+                                       writedata(wd, DATA, MEM_allocN_len(pm->index_array), pm->index_array);
                                
                                for(i=0; i<BPHYS_TOT_DATA; i++) {
                                        if(pm->data[i] && pm->data_types & (1<<i))
-                                               writedata(wd, DATA, BKE_ptcache_data_size(i) * pm->totpoint, pm->data[i]);
+                                               writedata(wd, DATA, MEM_allocN_len(pm->data[i]), pm->data[i]);
                                }
                        }
                }