Fix InputBlockingMod not always clearing last action on break periods

This commit is contained in:
Salman Ahmed 2022-09-16 19:48:24 +03:00
parent f512106bee
commit 557b39b69b

View File

@ -18,7 +18,7 @@ using osu.Game.Utils;
namespace osu.Game.Rulesets.Osu.Mods namespace osu.Game.Rulesets.Osu.Mods
{ {
public abstract class InputBlockingMod : Mod, IApplicableToDrawableRuleset<OsuHitObject> public abstract class InputBlockingMod : Mod, IApplicableToDrawableRuleset<OsuHitObject>, IUpdatableByPlayfield
{ {
public override double ScoreMultiplier => 1.0; public override double ScoreMultiplier => 1.0;
public override Type[] IncompatibleMods => new[] { typeof(ModAutoplay), typeof(ModRelax), typeof(OsuModCinema) }; public override Type[] IncompatibleMods => new[] { typeof(ModAutoplay), typeof(ModRelax), typeof(OsuModCinema) };
@ -62,15 +62,18 @@ namespace osu.Game.Rulesets.Osu.Mods
gameplayClock = drawableRuleset.FrameStableClock; gameplayClock = drawableRuleset.FrameStableClock;
} }
public void Update(Playfield playfield)
{
if (LastAcceptedAction != null && nonGameplayPeriods.IsInAny(gameplayClock.CurrentTime))
LastAcceptedAction = null;
}
protected abstract bool CheckValidNewAction(OsuAction action); protected abstract bool CheckValidNewAction(OsuAction action);
private bool checkCorrectAction(OsuAction action) private bool checkCorrectAction(OsuAction action)
{ {
if (nonGameplayPeriods.IsInAny(gameplayClock.CurrentTime)) if (nonGameplayPeriods.IsInAny(gameplayClock.CurrentTime))
{
LastAcceptedAction = null;
return true; return true;
}
switch (action) switch (action)
{ {