mirror of
https://github.com/ppy/osu
synced 2025-03-04 10:29:37 +00:00
Fix possible CollectionModifiedException while adding new SpeedAdjustmentContainers
This commit is contained in:
parent
b7b8d8b764
commit
6f662d721c
@ -185,14 +185,18 @@ namespace osu.Game.Rulesets.UI
|
||||
if (previousSpeedAdjustment == null)
|
||||
return;
|
||||
|
||||
foreach (DrawableHitObject h in previousSpeedAdjustment.Children)
|
||||
for (int i = 0; i < previousSpeedAdjustment.Children.Count; i++)
|
||||
{
|
||||
var newSpeedAdjustment = adjustmentContainerFor(h);
|
||||
DrawableHitObject hitObject = previousSpeedAdjustment[i];
|
||||
|
||||
var newSpeedAdjustment = adjustmentContainerFor(hitObject);
|
||||
if (newSpeedAdjustment == previousSpeedAdjustment)
|
||||
continue;
|
||||
|
||||
previousSpeedAdjustment.Remove(h);
|
||||
newSpeedAdjustment.Add(h);
|
||||
previousSpeedAdjustment.Remove(hitObject);
|
||||
newSpeedAdjustment.Add(hitObject);
|
||||
|
||||
i--;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user