diff --git a/Assets/Scripts/OpenTS2/Files/Formats/DBPF/SimsObjectCodec.cs b/Assets/Scripts/OpenTS2/Files/Formats/DBPF/SimsObjectCodec.cs index fae13dd..7b7f583 100644 --- a/Assets/Scripts/OpenTS2/Files/Formats/DBPF/SimsObjectCodec.cs +++ b/Assets/Scripts/OpenTS2/Files/Formats/DBPF/SimsObjectCodec.cs @@ -52,6 +52,10 @@ private static SimsObjectAsset DeserializeWithVersion(IoBuffer reader, int versi var elevation = reader.ReadFloat(); var objectGroupId = reader.ReadInt32(); reader.ReadInt16(); // unknown + if (version > 0xD6) + { + reader.ReadFloat(); // unknown + } var numAttrs = reader.ReadInt16(); var attrs = new short[numAttrs]; @@ -78,6 +82,7 @@ private static SimsObjectAsset DeserializeWithVersion(IoBuffer reader, int versi uint numShorts = version switch { 0xAD => 0x58, + 0xD8 => 0x72, _ => throw new NotImplementedException($"SimObjectCodec not implemented for version {version:X}"), }; @@ -101,7 +106,14 @@ private static SimsObjectAsset DeserializeWithVersion(IoBuffer reader, int versi // Inventory token. var tokenGUID = reader.ReadUInt32(); var tokenFlags = reader.ReadUInt16(); + if (version > 0xCA) + { + var stackId = reader.ReadInt16(); + var personalInventoryInstanceId = reader.ReadInt32(); + var tokenCategory = reader.ReadUInt16(); + } var numTokenProperties = reader.ReadUInt32(); + for (var i = 0; i < numTokenProperties; i++) { reader.ReadUInt16();