Skip to content

Commit

Permalink
Fix Holds resetting holdstarttime on every input
Browse files Browse the repository at this point in the history
  • Loading branch information
LumpBloom7 committed Feb 21, 2024
1 parent b7f5d66 commit 0d748ab
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableHold.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ protected override void ClearNestedHitObjects()

private bool beginHoldAt(double timeOffset)
{
if (HoldStartTime is not null)
return false;

if (timeOffset < -Head.HitObject.HitWindows.WindowFor(HitResult.Miss))
return false;

Expand All @@ -225,15 +228,14 @@ public bool OnPressed(KeyBindingPressEvent<SentakkiAction> e)
if (e.Action != SentakkiAction.Key1 + HitObject.Lane)
return false;

pressedCount++;

if (beginHoldAt(Time.Current - Head.HitObject.StartTime))
{
Head.UpdateResult();
NoteBody.FadeColour(AccentColour.Value, 50);
}

// Only the first input to this hitobject will be blocked
if (pressedCount++ == 0)
return true;
}

// Passthrough excess inputs to later hitobjects in the same lane
return false;
Expand Down

0 comments on commit 0d748ab

Please sign in to comment.