mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 12:17:46 +08:00
Ensure to not multiply by 0
This commit is contained in:
parent
c3b365cf6b
commit
c466d6df94
@ -239,6 +239,10 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
case ScoringMode.Classic:
|
case ScoringMode.Classic:
|
||||||
int totalHitObjects = statistics.Where(k => k.Key >= HitResult.Miss && k.Key <= HitResult.Perfect).Sum(k => k.Value);
|
int totalHitObjects = statistics.Where(k => k.Key >= HitResult.Miss && k.Key <= HitResult.Perfect).Sum(k => k.Value);
|
||||||
|
|
||||||
|
// If there are no hitobjects then the beatmap can be composed of only ticks or spinners, so ensure we don't multiply by 0 at all times.
|
||||||
|
if (totalHitObjects == 0)
|
||||||
|
totalHitObjects = 1;
|
||||||
|
|
||||||
// This gives a similar feeling to osu!stable scoring (ScoreV1) while keeping classic scoring as only a constant multiple of standardised scoring.
|
// This gives a similar feeling to osu!stable scoring (ScoreV1) while keeping classic scoring as only a constant multiple of standardised scoring.
|
||||||
// The invariant is important to ensure that scores don't get re-ordered on leaderboards between the two scoring modes.
|
// The invariant is important to ensure that scores don't get re-ordered on leaderboards between the two scoring modes.
|
||||||
double scaledStandardised = GetScore(ScoringMode.Standardised, accuracyRatio, comboRatio, statistics) / max_score;
|
double scaledStandardised = GetScore(ScoringMode.Standardised, accuracyRatio, comboRatio, statistics) / max_score;
|
||||||
|
Loading…
Reference in New Issue
Block a user