Purge manual breaks if they intersect with an actual hitobject

This commit is contained in:
Bartłomiej Dach 2024-06-19 10:51:37 +02:00
parent 7ed587b783
commit 7311a7ffd7
No known key found for this signature in database
1 changed files with 6 additions and 0 deletions

View File

@ -38,6 +38,12 @@ private void autoGenerateBreaks()
{
Beatmap.Breaks.RemoveAll(b => b is not ManualBreakPeriod);
foreach (var manualBreak in Beatmap.Breaks.ToList())
{
if (Beatmap.HitObjects.Any(ho => ho.StartTime <= manualBreak.EndTime && ho.GetEndTime() >= manualBreak.StartTime))
Beatmap.Breaks.Remove(manualBreak);
}
for (int i = 1; i < Beatmap.HitObjects.Count; ++i)
{
double previousObjectEndTime = Beatmap.HitObjects[i - 1].GetEndTime();