diff --git a/project/code/LGS/Database/Chunks/Property.cs b/project/code/LGS/Database/Chunks/Property.cs index 81362eb..c3e6cad 100644 --- a/project/code/LGS/Database/Chunks/Property.cs +++ b/project/code/LGS/Database/Chunks/Property.cs @@ -96,11 +96,18 @@ public class PropRenderType : Property public class PropString : Property { + public int stringLength; public string value; public override void Read(BinaryReader reader) { base.Read(reader); - value = Encoding.UTF8.GetString(reader.ReadBytes(length)).Replace("\0", string.Empty); + stringLength = reader.ReadInt32(); + var tmpName = Encoding.UTF8.GetString(reader.ReadBytes(stringLength)); + var idx = tmpName.IndexOf('\0'); + if (idx >= 0) tmpName = tmpName[..idx]; + value = tmpName; + // var tmpName = Encoding.UTF8.GetString(reader.ReadBytes(length)).Replace("\0", string.Empty); + // value = tmpName[..Math.Min(length - 1, tmpName.Length)]; } }