mirror of
https://github.com/ppy/osu
synced 2025-03-04 18:40:24 +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)
|
if (previousSpeedAdjustment == null)
|
||||||
return;
|
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)
|
if (newSpeedAdjustment == previousSpeedAdjustment)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
previousSpeedAdjustment.Remove(h);
|
previousSpeedAdjustment.Remove(hitObject);
|
||||||
newSpeedAdjustment.Add(h);
|
newSpeedAdjustment.Add(hitObject);
|
||||||
|
|
||||||
|
i--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user