diff --git a/osu.Game.Rulesets.Osu/Scoring/OsuHealthProcessor.cs b/osu.Game.Rulesets.Osu/Scoring/OsuHealthProcessor.cs index 9ed1820045..7d6a05026c 100644 --- a/osu.Game.Rulesets.Osu/Scoring/OsuHealthProcessor.cs +++ b/osu.Game.Rulesets.Osu/Scoring/OsuHealthProcessor.cs @@ -48,7 +48,7 @@ namespace osu.Game.Rulesets.Osu.Scoring double currentHp; double currentHpUncapped; - do + while (true) { currentHp = 1; currentHpUncapped = 1; @@ -57,7 +57,6 @@ namespace osu.Game.Rulesets.Osu.Scoring double lastTime = DrainStartTime; int currentBreak = 0; bool fail = false; - string failReason = string.Empty; for (int i = 0; i < Beatmap.HitObjects.Count; i++) { @@ -92,7 +91,7 @@ namespace osu.Game.Rulesets.Osu.Scoring { fail = true; testDrop *= 0.96; - failReason = $"hp too low ({currentHp} < {lowestHpEver})"; + OnIterationFail?.Invoke($"FAILED drop {testDrop}: hp too low ({currentHp} < {lowestHpEver})"); break; } @@ -117,7 +116,7 @@ namespace osu.Game.Rulesets.Osu.Scoring { fail = true; testDrop *= 0.96; - failReason = $"overkill ({currentHp} - {hpOverkill} <= {lowestHpEver})"; + OnIterationFail?.Invoke($"FAILED drop {testDrop}: overkill ({currentHp} - {hpOverkill} <= {lowestHpEver})"); break; } @@ -129,7 +128,7 @@ namespace osu.Game.Rulesets.Osu.Scoring fail = true; testDrop *= 0.94; hpMultiplierNormal *= 1.01; - failReason = $"end hp too low ({currentHp} < {lowestHpEnd})"; + OnIterationFail?.Invoke($"FAILED drop {testDrop}: end hp too low ({currentHp} < {lowestHpEnd})"); } double recovery = (currentHpUncapped - 1) / Beatmap.HitObjects.Count; @@ -139,18 +138,15 @@ namespace osu.Game.Rulesets.Osu.Scoring fail = true; testDrop *= 0.96; hpMultiplierNormal *= 1.01; - failReason = $"recovery too low ({recovery} < {hpRecoveryAvailable})"; + OnIterationFail?.Invoke($"FAILED drop {testDrop}: recovery too low ({recovery} < {hpRecoveryAvailable})"); } - if (fail) + if (!fail) { - OnIterationFail?.Invoke($"FAILED drop {testDrop}: {failReason}"); - continue; + OnIterationSuccess?.Invoke($"PASSED drop {testDrop}"); + return testDrop; } - - OnIterationSuccess?.Invoke($"PASSED drop {testDrop}"); - return testDrop; - } while (true); + } void reduceHp(double amount) {