diff --git a/src/clump.cpp b/src/clump.cpp index c8d27ba..b3f3d72 100644 --- a/src/clump.cpp +++ b/src/clump.cpp @@ -409,7 +409,8 @@ Clump::frameListStreamWrite(Stream *stream, Frame **frameList, int32 numFrames) buf.pos[0] = f->matrix[12]; buf.pos[1] = f->matrix[13]; buf.pos[2] = f->matrix[14]; - buf.parent = findPointer((void*)f, (void**)frameList,numFrames); + buf.parent = findPointer((void*)f->parent, (void**)frameList, + numFrames); buf.matflag = f->matflag; stream->write(&buf, sizeof(buf)); } diff --git a/src/plugins.cpp b/src/plugins.cpp index 8708ff7..6546d4b 100644 --- a/src/plugins.cpp +++ b/src/plugins.cpp @@ -60,7 +60,7 @@ copyHAnim(void *dst, void *src, int32 offset, int32) static void readHAnim(Stream *stream, int32, void *object, int32 offset, int32) { - int32 cnst, numNodes; + int32 ver, numNodes; HAnimData *hanim = PLUGINOFFSET(HAnimData, object, offset); ver = stream->readI32(); if(ver != 0x100){ @@ -120,8 +120,11 @@ static int32 getSizeHAnim(void *object, int32 offset, int32) { HAnimData *hanim = PLUGINOFFSET(HAnimData, object, offset); + if(version >= 0x34000 && hanim->id == -1 && hanim->hierarchy == NULL) + return -1; if(hanim->hierarchy) return 12 + 8 + hanim->hierarchy->numNodes*12; + // TODO: version correct? return 12; }