From 44cdb28520deee8780a510f119822150913b90c6 Mon Sep 17 00:00:00 2001 From: Razmoth <12517189-Razmoth@users.noreply.gitlab.com> Date: Sat, 7 Jan 2023 16:20:54 +0400 Subject: [PATCH] fix #2 --- AssetStudio/Classes/AnimationClip.cs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/AssetStudio/Classes/AnimationClip.cs b/AssetStudio/Classes/AnimationClip.cs index 7549143..bebecde 100644 --- a/AssetStudio/Classes/AnimationClip.cs +++ b/AssetStudio/Classes/AnimationClip.cs @@ -462,7 +462,14 @@ namespace AssetStudio public uint m_CurveCount; public uint m_ConstCurveCount; - public ACLClip(ObjectReader reader) + + public ACLClip() + { + m_CurveCount = 0; + m_ConstCurveCount = 0; + m_ClipData = Array.Empty(); + } + public void Read(ObjectReader reader) { var byteCount = reader.ReadInt32(); @@ -481,6 +488,8 @@ namespace AssetStudio m_ConstCurveCount = reader.ReadUInt32(); } } + + public bool IsSet => m_CurveCount > 0; } public class StreamedClip @@ -646,7 +655,7 @@ namespace AssetStudio public class Clip { - public ACLClip m_ACLClip; + public ACLClip m_ACLClip = new(); public StreamedClip m_StreamedClip; public DenseClip m_DenseClip; public ConstantClip m_ConstantClip; @@ -659,7 +668,7 @@ namespace AssetStudio m_DenseClip = new DenseClip(reader); if (reader.Game.Type.IsSRGroup()) { - m_ACLClip = new ACLClip(reader); + m_ACLClip.Read(reader); } if (version[0] > 4 || (version[0] == 4 && version[1] >= 3)) //4.3 and up { @@ -667,7 +676,7 @@ namespace AssetStudio } if (reader.Game.Type.IsGIGroup() || reader.Game.Type.IsBH3() || reader.Game.Type.IsZZZCB1()) { - m_ACLClip = new ACLClip(reader); + m_ACLClip.Read(reader); } if (version[0] < 2018 || (version[0] == 2018 && version[1] < 3)) //2018.3 down {