Fix multiple hits in the same frame pressing multiple hitobjects

This commit is contained in:
smoogipoo 2018-09-25 18:37:25 +09:00
parent 5e51a50658
commit 5f61faa2d9
1 changed files with 13 additions and 0 deletions

View File

@ -24,6 +24,8 @@ public abstract class DrawableHit : DrawableTaikoHitObject<Hit>
private bool validActionPressed;
private bool handleExtraPress;
protected DrawableHit(Hit hit)
: base(hit)
{
@ -51,6 +53,9 @@ protected override void CheckForResult(bool userTriggered, double timeOffset)
public override bool OnPressed(TaikoAction action)
{
if (handleExtraPress)
return true;
if (Judged)
return false;
@ -62,6 +67,10 @@ public override bool OnPressed(TaikoAction action)
if (IsHit)
HitAction = action;
// Regardless of whether we've hit or not, any secondary key presses in the same frame should be discarded
// E.g. hitting a non-strong centre as a strong should not fall through and perform a hit on the next note
handleExtraPress = true;
return result;
}
@ -76,6 +85,10 @@ protected override void Update()
{
base.Update();
// The input manager processes all input prior to us updating, so this is the perfect time
// for us to remove the extra press blocking, before input is handled in the next frame
handleExtraPress = false;
Size = BaseSize * Parent.RelativeChildSize;
}