Skip to content

Commit

Permalink
Merge pull request ppy#27677 from smoogipoo/fix-catch-banana-fail
Browse files Browse the repository at this point in the history
Fix catch banana shower judgement causing fail when at 0 HP
  • Loading branch information
bdach authored Mar 21, 2024
2 parents c081cc7 + bf56400 commit 983385b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions osu.Game.Rulesets.Catch.Tests/CatchHealthProcessorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ [new Fruit(), 0.01, true],
[new Droplet(), 0.01, true],
[new TinyDroplet(), 0, false],
[new Banana(), 0, false],
[new BananaShower(), 0, false]
];

[TestCaseSource(nameof(test_cases))]
Expand Down
4 changes: 4 additions & 0 deletions osu.Game.Rulesets.Catch/Scoring/CatchHealthProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ protected override bool CheckDefaultFailCondition(JudgementResult result)
if (result.Type == HitResult.SmallTickMiss)
return false;

// on stable, banana showers don't exist as concrete objects themselves, so they can't cause a fail.
if (result.HitObject is BananaShower)
return false;

return base.CheckDefaultFailCondition(result);
}

Expand Down
3 changes: 3 additions & 0 deletions osu.Game/Rulesets/Scoring/LegacyDrainingHealthProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ protected override double ComputeDrainRate()
increaseHp(h);
}

if (topLevelObjectCount == 0)
return testDrop;

if (!fail && currentHp < lowestHpEnd)
{
fail = true;
Expand Down

0 comments on commit 983385b

Please sign in to comment.