Fixed some binary file save problems.

This commit is contained in:
CloneTrooper1019
2019-06-10 20:27:57 -05:00
parent 5b85043194
commit 41c84dc49c
4 changed files with 72 additions and 48 deletions

View File

@ -510,9 +510,16 @@ namespace RobloxFiles.BinaryFormat.Chunks
case PropertyType.String:
props.ForEach(prop =>
{
byte[] rawBuffer = prop.RawBuffer;
writer.Write(rawBuffer.Length);
writer.Write(rawBuffer);
byte[] buffer = prop.HasRawBuffer ? prop.RawBuffer : null;
if (buffer == null)
{
string value = prop.CastValue<string>();
buffer = Encoding.UTF8.GetBytes(value);
}
writer.Write(buffer.Length);
writer.Write(buffer);
});
break;