Fix catch auto generator not considering circle size

This commit is contained in:
Dan Balasescu 2024-08-30 00:48:53 +09:00
parent dd675fef45
commit 7435e8aa00
No known key found for this signature in database
1 changed files with 4 additions and 4 deletions

View File

@ -16,9 +16,12 @@ internal class CatchAutoGenerator : AutoGenerator<CatchReplayFrame>
{
public new CatchBeatmap Beatmap => (CatchBeatmap)base.Beatmap;
private readonly float halfCatcherWidth;
public CatchAutoGenerator(IBeatmap beatmap)
: base(beatmap)
{
halfCatcherWidth = Catcher.CalculateCatchWidth(beatmap.Difficulty) * 0.5f;
}
protected override void GenerateFrames()
@ -47,10 +50,7 @@ void moveToNext(PalpableCatchHitObject h)
bool dashRequired = speedRequired > Catcher.BASE_WALK_SPEED;
bool impossibleJump = speedRequired > Catcher.BASE_DASH_SPEED;
// todo: get correct catcher size, based on difficulty CS.
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)
if (lastPosition - halfCatcherWidth < h.EffectiveX && lastPosition + halfCatcherWidth > h.EffectiveX)
{
// we are already in the correct range.
lastTime = h.StartTime;