1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-27 01:02:54 +08:00

Simplify the fruit stacking code

It is now more clear that
the expression of distance checking is probably unintended (a bug)
This commit is contained in:
ekrctb 2020-12-02 20:05:01 +09:00
parent 8d32cca5d6
commit 873f2363c1
3 changed files with 3 additions and 4 deletions

View File

@ -16,8 +16,6 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
protected override double InitialLifetimeOffset => HitObject.TimePreempt;
public float DisplayRadius => DrawSize.X / 2 * Scale.X * HitObject.Scale;
protected override float SamplePlaybackPosition => HitObject.X / CatchPlayfield.WIDTH;
protected DrawableCatchHitObject([CanBeNull] CatchHitObject hitObject)

View File

@ -30,6 +30,8 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
/// </summary>
public virtual bool StaysOnPlate => true;
public float DisplayRadius => CatchHitObject.OBJECT_RADIUS * HitObject.Scale * ScaleFactor;
protected readonly Container ScaleContainer;
protected DrawablePalpableCatchHitObject([CanBeNull] CatchHitObject h)

View File

@ -204,8 +204,7 @@ namespace osu.Game.Rulesets.Catch.UI
const float allowance = 10;
while (caughtFruitContainer.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 = CatchHitObject.OBJECT_RADIUS / 2)) / (allowance / 2)))
{
var diff = (ourRadius + theirRadius) / allowance;
fruit.X += (RNG.NextSingle() - 0.5f) * diff * 2;