Skip to content

Commit cffc4eb

Browse files
committed
修复bpmevent的问题,发布V1.8.3.7
1 parent 9a85a8d commit cffc4eb

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

OsuParsers/Decoders/BeatmapDecoder.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ private void ProcessBPMEvent()
374374
var nextOffset = (i + 1 < Beatmap.TimingPoints.Count) ?
375375
Beatmap.TimingPoints[i + 1].Offset :
376376
Beatmap.GeneralSection.Length;
377-
double calculatedBPM = TP.BeatLength != 0 ? (Math.Round(60000.0 / Math.Abs(TP.BeatLength),3)) : 0;
377+
double calculatedBPM = TP.BeatLength <= 0 ? TP.BeatLength : Math.Round(60000.0 / TP.BeatLength,3);
378378
var bpmEvent = new BPMEvent
379379
{
380380
Offset = TP.Offset,
@@ -384,10 +384,11 @@ private void ProcessBPMEvent()
384384
};
385385
Beatmap.BPMEvents.Add(bpmEvent);
386386
}
387+
Beatmap.BPMEvents.RemoveAll(bpmEvent => bpmEvent.BeatLength < 0);
387388
Beatmap.BPMEvents.Sort((x, y) => x.Offset.CompareTo(y.Offset));
388389
Beatmap.MaxBPM = Beatmap.BPMEvents.Max(x => x.BPM);
389390
Beatmap.MinBPM = Beatmap.BPMEvents.Min(x => x.BPM);
390-
Beatmap.BPMEvents.RemoveAll(bpmEvent => bpmEvent.BeatLength < 0);
391+
391392
for (int i = 0; i < Beatmap.BPMEvents.Count; i++)
392393
{
393394
if (i < Beatmap.BPMEvents.Count - 1)

0 commit comments

Comments
 (0)