Skip to content

Commit

Permalink
Only update combo information when any changes happened
Browse files Browse the repository at this point in the history
  • Loading branch information
bdach committed Jan 8, 2025
1 parent fbfda2e commit 7c70dc4
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions osu.Game/Screens/Edit/EditorBeatmapProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,20 +111,29 @@ private void ensureNewComboAfterBreaks()

int currentBreak = 0;

for (int i = 0; i < Beatmap.HitObjects.Count; ++i)
{
var hitObject = Beatmap.HitObjects[i];
IHasComboInformation? lastObj = null;
bool comboInformationUpdateRequired = false;

foreach (var hitObject in Beatmap.HitObjects)
{
if (hitObject is not IHasComboInformation hasCombo)
continue;

if (currentBreak < breakEnds.Count && hitObject.StartTime >= breakEnds[currentBreak])
{
hasCombo.NewCombo = true;
if (!hasCombo.NewCombo)
{
hasCombo.NewCombo = true;
comboInformationUpdateRequired = true;
}

currentBreak += 1;
}

hasCombo.UpdateComboInformation(i > 0 ? Beatmap.HitObjects[i - 1] as IHasComboInformation : null);
if (comboInformationUpdateRequired)
hasCombo.UpdateComboInformation(lastObj);

lastObj = hasCombo;
}
}
}
Expand Down

0 comments on commit 7c70dc4

Please sign in to comment.