Skip to content

Commit

Permalink
Fixes for Transformers: Fall of Cybertron
Browse files Browse the repository at this point in the history
  • Loading branch information
gildor2 committed Aug 7, 2021
1 parent 90ac5bd commit 10fdbca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions MeshInstance/SkelMeshInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -507,8 +507,8 @@ void CSkelMeshInstance::UpdateSkeleton()
BoneDebug.AnimRotation = Bone.Orientation;
#endif // SHOW_ANIM

// compute bone orientation
if (AnimSeq1 && AnimBoneIndex != INDEX_NONE && AnimSeq1->Tracks[AnimBoneIndex]->HasKeys())
// compute bone orientation, take care of empty Tracks array
if (AnimSeq1 && AnimBoneIndex != INDEX_NONE && AnimSeq1->Tracks.IsValidIndex(AnimBoneIndex) && AnimSeq1->Tracks[AnimBoneIndex]->HasKeys())
{
// get bone position from track
if (!AnimSeq2 || Chn->SecondaryBlend != 1.0f)
Expand Down
6 changes: 6 additions & 0 deletions Unreal/UnrealMesh/UnAnim3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,12 @@ void UAnimSequence::DecodeTrans3Anims(CAnimSequence *Dst, UAnimSet *Owner) const
{
guard(UAnimSequence::DecodeTrans3Anims);

if (CompressedByteStream.Num() == 0)
{
// This situation is true for some sequences
return;
}

// read some counts first
FMemReader Reader1(Trans3Data.GetData(), Trans3Data.Num());
Reader1.SetupFrom(*Package);
Expand Down

0 comments on commit 10fdbca

Please sign in to comment.