1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-21 23:36:10 +08:00

Attempt to fix CI failures on CatcherArea.Explode

This commit is contained in:
Dean Herbert 2018-09-05 16:45:30 +09:00
parent 9b753bb429
commit c03d1d9566

View File

@ -57,7 +57,7 @@ namespace osu.Game.Rulesets.Catch.UI
// this is required to make this run after the last caught fruit runs UpdateState at least once. // this is required to make this run after the last caught fruit runs UpdateState at least once.
// TODO: find a better alternative // TODO: find a better alternative
if (lastPlateableFruit.IsLoaded) if (lastPlateableFruit.LoadState > LoadState.Ready)
action(); action();
else else
lastPlateableFruit.OnLoadComplete = _ => action(); lastPlateableFruit.OnLoadComplete = _ => action();
@ -407,9 +407,7 @@ namespace osu.Game.Rulesets.Catch.UI
/// </summary> /// </summary>
public void Explode() public void Explode()
{ {
var fruit = caughtFruit.ToArray(); foreach (var f in caughtFruit.ToArray())
foreach (var f in fruit)
Explode(f); Explode(f);
} }
@ -422,15 +420,15 @@ namespace osu.Game.Rulesets.Catch.UI
fruit.Anchor = Anchor.TopLeft; fruit.Anchor = Anchor.TopLeft;
fruit.Position = caughtFruit.ToSpaceOfOtherDrawable(fruit.DrawPosition, ExplodingFruitTarget); fruit.Position = caughtFruit.ToSpaceOfOtherDrawable(fruit.DrawPosition, ExplodingFruitTarget);
caughtFruit.Remove(fruit); if (!caughtFruit.Remove(fruit))
// we may have already been removed by a previous operation (due to the weird OnLoadComplete scheduling).
// this avoids a crash on potentially attempting to Add a fruit to ExplodingFruitTarget twice.
return;
ExplodingFruitTarget.Add(fruit); ExplodingFruitTarget.Add(fruit);
} }
fruit.MoveToY(fruit.Y - 50, 250, Easing.OutSine) fruit.MoveToY(fruit.Y - 50, 250, Easing.OutSine).Then().MoveToY(fruit.Y + 50, 500, Easing.InSine);
.Then()
.MoveToY(fruit.Y + 50, 500, Easing.InSine);
fruit.MoveToX(fruit.X + originalX * 6, 1000); fruit.MoveToX(fruit.X + originalX * 6, 1000);
fruit.FadeOut(750); fruit.FadeOut(750);