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

Merge pull request #14025 from ekrctb/simplify-can-catch

Remove outdated comment and simplify code in `Catcher.CanCatch`
This commit is contained in:
Dean Herbert 2021-07-26 19:27:33 +09:00 committed by GitHub
commit 8837340ac3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -218,14 +218,9 @@ namespace osu.Game.Rulesets.Catch.UI
if (!(hitObject is PalpableCatchHitObject fruit))
return false;
var halfCatchWidth = catchWidth * 0.5f;
// this stuff wil disappear once we move fruit to non-relative coordinate space in the future.
var catchObjectPosition = fruit.EffectiveX;
var catcherPosition = Position.X;
return catchObjectPosition >= catcherPosition - halfCatchWidth &&
catchObjectPosition <= catcherPosition + halfCatchWidth;
float halfCatchWidth = catchWidth * 0.5f;
return fruit.EffectiveX >= X - halfCatchWidth &&
fruit.EffectiveX <= X + halfCatchWidth;
}
public void OnNewResult(DrawableCatchHitObject drawableObject, JudgementResult result)