Fix reading/writing of Dat54WrapperSound

This commit is contained in:
alexguirre 2022-03-14 21:40:29 +01:00
parent 8998b8c808
commit f82f2ea7bf

View File

@ -2673,11 +2673,12 @@ namespace CodeWalker.GameFiles
MinRepeatTime = br.ReadInt16(); MinRepeatTime = br.ReadInt16();
VariableCount = br.ReadByte(); VariableCount = br.ReadByte();
VariableNames = new MetaHash[VariableCount]; VariableNames = new MetaHash[VariableCount];
VariableValues = new byte[VariableCount];
for (int i = 0; i < VariableCount; i++) for (int i = 0; i < VariableCount; i++)
{ {
VariableNames[i] = br.ReadUInt32(); VariableNames[i] = br.ReadUInt32();
VariableValues[i] = br.ReadByte();
} }
VariableValues = br.ReadBytes(VariableCount);
ChildSoundsHashes = new[] { ChildSound, FallBackSound }; ChildSoundsHashes = new[] { ChildSound, FallBackSound };
} }
@ -2743,13 +2744,8 @@ namespace CodeWalker.GameFiles
for (int i = 0; i < VariableCount; i++) for (int i = 0; i < VariableCount; i++)
{ {
bw.Write(VariableNames[i]); bw.Write(VariableNames[i]);
bw.Write(VariableValues[i]);
} }
if (VariableValues != null)
{
bw.Write(VariableValues);
}
else
{ }
} }
public override uint[] GetHashTableOffsets() public override uint[] GetHashTableOffsets()
{ {