Skip to content

Commit 10fdbca

Browse files
committed
Fixes for Transformers: Fall of Cybertron
https://www.gildor.org/smf/index.php/topic,7866.0.html
1 parent 90ac5bd commit 10fdbca

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

MeshInstance/SkelMeshInstance.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,8 @@ void CSkelMeshInstance::UpdateSkeleton()
507507
BoneDebug.AnimRotation = Bone.Orientation;
508508
#endif // SHOW_ANIM
509509

510-
// compute bone orientation
511-
if (AnimSeq1 && AnimBoneIndex != INDEX_NONE && AnimSeq1->Tracks[AnimBoneIndex]->HasKeys())
510+
// compute bone orientation, take care of empty Tracks array
511+
if (AnimSeq1 && AnimBoneIndex != INDEX_NONE && AnimSeq1->Tracks.IsValidIndex(AnimBoneIndex) && AnimSeq1->Tracks[AnimBoneIndex]->HasKeys())
512512
{
513513
// get bone position from track
514514
if (!AnimSeq2 || Chn->SecondaryBlend != 1.0f)

Unreal/UnrealMesh/UnAnim3.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,12 @@ void UAnimSequence::DecodeTrans3Anims(CAnimSequence *Dst, UAnimSet *Owner) const
299299
{
300300
guard(UAnimSequence::DecodeTrans3Anims);
301301

302+
if (CompressedByteStream.Num() == 0)
303+
{
304+
// This situation is true for some sequences
305+
return;
306+
}
307+
302308
// read some counts first
303309
FMemReader Reader1(Trans3Data.GetData(), Trans3Data.Num());
304310
Reader1.SetupFrom(*Package);

0 commit comments

Comments
 (0)