From 9fbe2fa80a140eef3a8babf39c02bd003db56bb9 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sun, 21 Jun 2020 19:31:00 +0900 Subject: [PATCH] Add comments, change to clamp --- osu.Game/Rulesets/Scoring/DrainingHealthProcessor.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Scoring/DrainingHealthProcessor.cs b/osu.Game/Rulesets/Scoring/DrainingHealthProcessor.cs index 2d3754841b..ef341575fa 100644 --- a/osu.Game/Rulesets/Scoring/DrainingHealthProcessor.cs +++ b/osu.Game/Rulesets/Scoring/DrainingHealthProcessor.cs @@ -101,8 +101,12 @@ namespace osu.Game.Rulesets.Scoring ))); targetMinimumHealth = BeatmapDifficulty.DifficultyRange(beatmap.BeatmapInfo.BaseDifficulty.DrainRate, min_health_target, mid_health_target, max_health_target); + + // Add back a portion of the amount of HP to be drained, depending on the lenience requested. targetMinimumHealth += drainLenience * (1 - targetMinimumHealth); - targetMinimumHealth = Math.Min(1, targetMinimumHealth); + + // Ensure the target HP is within an acceptable range. + targetMinimumHealth = Math.Clamp(targetMinimumHealth, 0, 1); base.ApplyBeatmap(beatmap); }