Skip to content

Commit

Permalink
Only parse BytesOfBeatmapEntry if version is less than 20191106
Browse files Browse the repository at this point in the history
  • Loading branch information
mrflashstudio committed Nov 10, 2019
1 parent 322a4b7 commit a98d1e5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion OsuParsers/Decoders/DatabaseDecoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ public static OsuDatabase DecodeOsu(Stream stream)
{
DbBeatmap beatmap = new DbBeatmap();

beatmap.BytesOfBeatmapEntry = r.ReadInt32();
if (db.OsuVersion < 20191106)
beatmap.BytesOfBeatmapEntry = r.ReadInt32();

beatmap.Artist = r.ReadString();
beatmap.ArtistUnicode = r.ReadString();
beatmap.Title = r.ReadString();
Expand Down
3 changes: 2 additions & 1 deletion OsuParsers/Writers/DatabaseWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ public static void WriteOsuDatabase(string path, OsuDatabase db)

foreach (var beatmap in db.Beatmaps)
{
writer.Write(beatmap.BytesOfBeatmapEntry);
if (db.OsuVersion < 20191106)
writer.Write(beatmap.BytesOfBeatmapEntry);
writer.Write(beatmap.Artist);
writer.Write(beatmap.ArtistUnicode);
writer.Write(beatmap.Title);
Expand Down

0 comments on commit a98d1e5

Please sign in to comment.