*/}}
Prechádzať zdrojové kódy

Fix merge undo issue.

YimingWu 1 rok pred
rodič
commit
0f02e78f2d
2 zmenil súbory, kde vykonal 4 pridanie a 2 odobranie
  1. 2 0
      la_tns_kernel.c
  2. 2 2
      resources/la_properties.c

+ 2 - 0
la_tns_kernel.c

@@ -3500,6 +3500,8 @@ void tnsDestroyObject(tnsObject *o){
 
     lstRemoveItem(&T->World.AllObjects, o);
 
+    if(o->InRoot){ lstRemovePointerLeave(&o->InRoot->ChildObjects, o); }
+
     if(o->Type==TNS_OBJECT_MESH){ tnsMeshObject* mo=o;
         if(mo->v) arrFree(&mo->v, &mo->maxv); if(mo->e) arrFree(&mo->e, &mo->maxe);
         if(mo->f){ for(int i=0;i<mo->totf;i++){ free(mo->f[i].loop); mo->f[i].loop=0; } arrFree(&mo->f, &mo->maxf); }

+ 2 - 2
resources/la_properties.c

@@ -790,11 +790,11 @@ void* tnsget_MeshObjectFaceRaw(tnsMeshObject* o, int* r_size, int* r_is_copy){
     }
     *r_size = i*sizeof(int);
     *r_is_copy = 1;
-    return arr; 
+    return arr;
 }
 void tnsset_MeshObjectFaceRaw(tnsMeshObject* o, int* data, int s){
     if(o->f){
-        for(int fi=0;fi<o->totf;fi++){
+        for(int fi=0;fi<o->maxf;fi++){ // ??? due to undo property order, maxf can be != totf, will it have problems?
             if(o->f[fi].loop){ free(o->f[fi].loop); o->f[fi].loop=0; }
         }
         arrFree(&o->f, &o->maxf); o->totf=0;