Skip to content

Commit

Permalink
Apply suggested changes to fix implementation + tests
Browse files Browse the repository at this point in the history
  • Loading branch information
smoogipoo committed Aug 30, 2024
1 parent 464378f commit 81854e2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions osu.Game/Rulesets/Scoring/HealthProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ protected override void ApplyResultInternal(JudgementResult result)

if (CheckDefaultFailCondition(result))
{
bool allowFail = false;
bool allowFail = true;

for (int i = 0; i < Mods.Value.Count; i++)
{
if (Mods.Value[i] is IBlockFail blockMod)
{
// Intentionally does not early return so that all mods have a chance to update internal states (e.g. ModEasyWithExtraLives).
allowFail |= blockMod.AllowFail();
allowFail &= blockMod.AllowFail();
break;
}
}
Expand Down
6 changes: 3 additions & 3 deletions osu.Game/Tests/Visual/ModForceFailTestScene.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ public ModFailConditionTestPlayer(ModTestData data, bool allowFail)

protected override bool CheckModsAllowFailure() => true;

public bool CheckFailed(bool failed)
public bool CheckFailed(bool shouldHaveFailed)
{
if (!failed)
if (!shouldHaveFailed)
return ScoreProcessor.HasCompleted.Value && !HealthProcessor.HasFailed;

return HealthProcessor.HasFailed;
return HealthProcessor.HasFailed || ScoreProcessor.HasFailed;
}
}

Expand Down

0 comments on commit 81854e2

Please sign in to comment.