Skip to content

Commit

Permalink
fix problem on older osu file format
Browse files Browse the repository at this point in the history
  • Loading branch information
tmokmss committed May 20, 2018
1 parent c8bee7e commit f7c04f0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions osuBMParser/OsuFileParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ private void timingPointParse(string data)

string[] tokens = data.Split(',');

if (tokens.Length < 8)
// older format sometimes don't have kiai field
if (tokens.Length < 7)
{
Debug.WriteLine("osuBMParser: Invalid TimingPoint line, no further information available");
return;
Expand All @@ -243,7 +244,10 @@ private void timingPointParse(string data)
if (tokens[4] != null) timingPoint.SampleSet = toInt(tokens[4]);
if (tokens[5] != null) timingPoint.Volume = toInt(tokens[5]);
if (tokens[6] != null) timingPoint.Inherited = toBool(tokens[6]);
if (tokens[7] != null) timingPoint.KiaiMode = toBool(tokens[7]);

if (tokens.Length > 7)
if (tokens[7] != null) timingPoint.KiaiMode = toBool(tokens[7]);
else timingPoint.KiaiMode = false;

beatmap.TimingPoints.Add(timingPoint);

Expand Down

0 comments on commit f7c04f0

Please sign in to comment.