From 0bbc15d24a6ba299aa5f3785a1b508f5210b5f3c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 4 Jan 2018 17:51:34 +0900 Subject: [PATCH] Clamp fruit to plate --- osu.Game.Rulesets.Catch/UI/CatcherArea.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs index 5f91b75919..262ea67742 100644 --- a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs +++ b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs @@ -174,13 +174,15 @@ namespace osu.Game.Rulesets.Catch.UI while (caughtFruit.Any(f => f.LifetimeEnd == double.MaxValue && - Vector2Extensions.Distance(f.Position, fruit.Position) < (ourRadius + (theirRadius = (f.DrawSize.X / 2 * f.Scale.X))) / (allowance / 2))) + Vector2Extensions.Distance(f.Position, fruit.Position) < (ourRadius + (theirRadius = f.DrawSize.X / 2 * f.Scale.X)) / (allowance / 2))) { float diff = (ourRadius + theirRadius) / allowance; fruit.X += (RNG.NextSingle() - 0.5f) * 2 * diff; fruit.Y -= RNG.NextSingle() * diff; } + fruit.X = MathHelper.Clamp(fruit.X, -CATCHER_SIZE / 2, CATCHER_SIZE / 2); + caughtFruit.Add(fruit); var catchObject = (CatchHitObject)fruit.HitObject;