Merge pull request #3493 from smoogipoo/fix-taiko-doublehits

Fix multiple hits in the same frame pressing multiple hitobjects
This commit is contained in:
Dean Herbert 2018-09-28 19:14:59 +09:00 committed by GitHub
commit 4e9833499f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 pressHandledThisFrame;
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 (pressHandledThisFrame)
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
pressHandledThisFrame = 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
pressHandledThisFrame = false;
Size = BaseSize * Parent.RelativeChildSize;
}