mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 07:42:57 +08:00
Fix multiple hits in the same frame pressing multiple hitobjects
This commit is contained in:
parent
5e51a50658
commit
5f61faa2d9
@ -24,6 +24,8 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|||||||
|
|
||||||
private bool validActionPressed;
|
private bool validActionPressed;
|
||||||
|
|
||||||
|
private bool handleExtraPress;
|
||||||
|
|
||||||
protected DrawableHit(Hit hit)
|
protected DrawableHit(Hit hit)
|
||||||
: base(hit)
|
: base(hit)
|
||||||
{
|
{
|
||||||
@ -51,6 +53,9 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|||||||
|
|
||||||
public override bool OnPressed(TaikoAction action)
|
public override bool OnPressed(TaikoAction action)
|
||||||
{
|
{
|
||||||
|
if (handleExtraPress)
|
||||||
|
return true;
|
||||||
|
|
||||||
if (Judged)
|
if (Judged)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -62,6 +67,10 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|||||||
if (IsHit)
|
if (IsHit)
|
||||||
HitAction = action;
|
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;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,6 +85,10 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|||||||
{
|
{
|
||||||
base.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;
|
Size = BaseSize * Parent.RelativeChildSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user