From f44b2ed920865ad873b0d534b738045cd6cafca8 Mon Sep 17 00:00:00 2001 From: KillzXGaming Date: Wed, 18 Mar 2020 14:10:37 -0400 Subject: [PATCH] Some more bcsv fixes --- File_Format_Library/FileFormats/BCSV/BCSV.cs | 2 +- File_Format_Library/FileFormats/BCSV/BCSVParse.cs | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/File_Format_Library/FileFormats/BCSV/BCSV.cs b/File_Format_Library/FileFormats/BCSV/BCSV.cs index d1b662f0..a612dac8 100644 --- a/File_Format_Library/FileFormats/BCSV/BCSV.cs +++ b/File_Format_Library/FileFormats/BCSV/BCSV.cs @@ -26,7 +26,7 @@ namespace FirstPlugin { using (var reader = new Toolbox.Library.IO.FileReader(stream, true)) { - return reader.CheckSignature(4, "VSCB", 12); + return reader.CheckSignature(4, "VSCB", 12) || Utils.GetExtension(FileName) == ".bcsv"; } } diff --git a/File_Format_Library/FileFormats/BCSV/BCSVParse.cs b/File_Format_Library/FileFormats/BCSV/BCSVParse.cs index 926e0908..b9d3f1bb 100644 --- a/File_Format_Library/FileFormats/BCSV/BCSVParse.cs +++ b/File_Format_Library/FileFormats/BCSV/BCSVParse.cs @@ -29,11 +29,15 @@ namespace FirstPlugin uint numEntries = reader.ReadUInt32(); uint entrySize = reader.ReadUInt32(); ushort numFields = reader.ReadUInt16(); - ushort version = reader.ReadUInt16(); - uint magic = reader.ReadUInt32(); - uint unk = reader.ReadUInt32(); //Always 100000 - reader.ReadUInt32();//0 - reader.ReadUInt32();//0 + byte flag1 = reader.ReadByte(); + byte flag2 = reader.ReadByte(); + if (flag1 == 1) + { + uint magic = reader.ReadUInt32(); + uint unk = reader.ReadUInt32(); //Always 100000 + reader.ReadUInt32();//0 + reader.ReadUInt32();//0 + } Field[] fields = new Field[numFields]; for (int i = 0; i < numFields; i++) {