mirror of
https://github.com/ppy/osu.git
synced 2025-01-18 11:43:22 +08:00
Only update combo information when any changes happened
This commit is contained in:
parent
fbfda2e044
commit
7c70dc4dc3
@ -111,20 +111,29 @@ namespace osu.Game.Screens.Edit
|
||||
|
||||
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])
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user