Parsing fixes.

This commit is contained in:
Razmoth
2022-10-08 20:29:25 +04:00
parent 68952f0e17
commit 2edba3a4c6
8 changed files with 25 additions and 31 deletions

View File

@@ -287,7 +287,7 @@ namespace AssetStudio
{
public uint m_AvatarSize;
public AvatarConstant m_Avatar;
public KeyValuePair<uint, string>[] m_TOS;
public Dictionary<uint, string> m_TOS;
public Avatar(ObjectReader reader) : base(reader)
{
@@ -295,10 +295,10 @@ namespace AssetStudio
m_Avatar = new AvatarConstant(reader);
int numTOS = reader.ReadInt32();
m_TOS = new KeyValuePair<uint, string>[numTOS];
m_TOS = new Dictionary<uint, string>(numTOS);
for (int i = 0; i < numTOS; i++)
{
m_TOS[i] = new KeyValuePair<uint, string>(reader.ReadUInt32(), reader.ReadAlignedString());
m_TOS.Add(reader.ReadUInt32(), reader.ReadAlignedString());
}
//HumanDescription m_HumanDescription 2019 and up
@@ -306,7 +306,8 @@ namespace AssetStudio
public string FindBonePath(uint hash)
{
return m_TOS.FirstOrDefault(pair => pair.Key == hash).Value;
m_TOS.TryGetValue(hash, out string path);
return path;
}
}
}