1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 15:22:55 +08:00

Fix draining processor failing gameplay on bonus misses and ignore hits

This commit is contained in:
Bartłomiej Dach 2024-02-13 12:26:37 +01:00
parent d07ea8f5b1
commit 16d893d40c
No known key found for this signature in database
2 changed files with 13 additions and 1 deletions

View File

@ -142,6 +142,11 @@ namespace osu.Game.Rulesets.Scoring
} }
} }
protected override bool CanFailOn(JudgementResult result)
{
return !result.Judgement.MaxResult.IsBonus() && result.Type != HitResult.IgnoreHit;
}
protected override void Reset(bool storeResults) protected override void Reset(bool storeResults)
{ {
base.Reset(storeResults); base.Reset(storeResults);

View File

@ -50,7 +50,7 @@ namespace osu.Game.Rulesets.Scoring
Health.Value += GetHealthIncreaseFor(result); Health.Value += GetHealthIncreaseFor(result);
if (meetsAnyFailCondition(result)) if (CanFailOn(result) && meetsAnyFailCondition(result))
TriggerFailure(); TriggerFailure();
} }
@ -68,6 +68,13 @@ namespace osu.Game.Rulesets.Scoring
/// <returns>The health increase.</returns> /// <returns>The health increase.</returns>
protected virtual double GetHealthIncreaseFor(JudgementResult result) => result.HealthIncrease; protected virtual double GetHealthIncreaseFor(JudgementResult result) => result.HealthIncrease;
/// <summary>
/// Whether a failure can occur on a given <paramref name="result"/>.
/// If the return value of this method is <see langword="false"/>, neither <see cref="DefaultFailCondition"/> nor <see cref="FailConditions"/> will be checked
/// after this <paramref name="result"/>.
/// </summary>
protected virtual bool CanFailOn(JudgementResult result) => true;
/// <summary> /// <summary>
/// The default conditions for failing. /// The default conditions for failing.
/// </summary> /// </summary>