1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-16 20:13:21 +08:00

Merge pull request #29646 from smoogipoo/fix-catch-auto

Fix catch auto generator not considering circle size
This commit is contained in:
Bartłomiej Dach 2024-08-30 11:08:22 +02:00 committed by GitHub
commit d3f31fad80
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -16,9 +16,12 @@ namespace osu.Game.Rulesets.Catch.Replays
{ {
public new CatchBeatmap Beatmap => (CatchBeatmap)base.Beatmap; public new CatchBeatmap Beatmap => (CatchBeatmap)base.Beatmap;
private readonly float halfCatcherWidth;
public CatchAutoGenerator(IBeatmap beatmap) public CatchAutoGenerator(IBeatmap beatmap)
: base(beatmap) : base(beatmap)
{ {
halfCatcherWidth = Catcher.CalculateCatchWidth(beatmap.Difficulty) * 0.5f;
} }
protected override void GenerateFrames() protected override void GenerateFrames()
@ -47,10 +50,7 @@ namespace osu.Game.Rulesets.Catch.Replays
bool dashRequired = speedRequired > Catcher.BASE_WALK_SPEED; bool dashRequired = speedRequired > Catcher.BASE_WALK_SPEED;
bool impossibleJump = speedRequired > Catcher.BASE_DASH_SPEED; bool impossibleJump = speedRequired > Catcher.BASE_DASH_SPEED;
// todo: get correct catcher size, based on difficulty CS. if (lastPosition - halfCatcherWidth < h.EffectiveX && lastPosition + halfCatcherWidth > h.EffectiveX)
const float catcher_width_half = Catcher.BASE_SIZE * 0.3f * 0.5f;
if (lastPosition - catcher_width_half < h.EffectiveX && lastPosition + catcher_width_half > h.EffectiveX)
{ {
// we are already in the correct range. // we are already in the correct range.
lastTime = h.StartTime; lastTime = h.StartTime;